Results 1 to 5 of 5

Thread: Crystal Report Formula

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2006
    Location
    Chennai, India
    Posts
    25

    Question Crystal Report Formula

    Hi to all,

    I am using VB6 and Crystal XI.

    I want to know how to pass values of Crystal report formulas.
    I hope , below example, let u clear what i am asking.

    I insert a Formula Field , @CompanyName in Crystal report. I am need to pass the value for this formula in VB Runtime.

    I don't know how to pass a value for crystal report formula.

    Can anyone help me?

    Advance Thanks.

    Regards,
    Suresh.

  2. #2
    Lively Member
    Join Date
    Mar 2006
    Posts
    94

    Re: Crystal Report Formula

    Quote Originally Posted by suresh.cgmohan
    Hi to all,

    I am using VB6 and Crystal XI.

    I want to know how to pass values of Crystal report formulas.
    I hope , below example, let u clear what i am asking.

    I insert a Formula Field , @CompanyName in Crystal report. I am need to pass the value for this formula in VB Runtime.

    I don't know how to pass a value for crystal report formula.

    Can anyone help me?

    Advance Thanks.

    Regards,
    Suresh.
    Try adding a parameter field to the report, passing the parameter value from VB and then use that parameter value in the formula instead of passing the value straight to the formula. Depending on the parameter type and what the formula requires, you may have to cast values. Make the parameter field invisible.

    HTH
    Energy can be neither created not destroyed. It can only be wasted.

    Red Green

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Sep 2006
    Location
    Chennai, India
    Posts
    25

    Wink Re: Crystal Report Formula

    Hi King_George,

    Thans for ur info.

    Passing value to Formula field from VB is accomplished.

    Now, i am need to know, how to pass the Selection Formula.
    Please send me one example in string and integer type.

    When i pass the value, 20515 Error Code displays and stops program execution.

    I used as below format:

    SelecForm = "{ItemMaster.ItemType} = 0"

    CrystalReport1.SelectionFormula = SelecForm

    ItemMaster.ItemType is Number Type. Database MS Access 2003.

    Can you help me?

    Advance Thanks,

    Regards,
    Suresh.

  4. #4
    Lively Member
    Join Date
    Mar 2006
    Posts
    94

    Re: Crystal Report Formula

    Quote Originally Posted by suresh.cgmohan
    Hi King_George,

    Thans for ur info.

    Passing value to Formula field from VB is accomplished.

    Now, i am need to know, how to pass the Selection Formula.
    Please send me one example in string and integer type.

    When i pass the value, 20515 Error Code displays and stops program execution.

    I used as below format:

    SelecForm = "{ItemMaster.ItemType} = 0"

    CrystalReport1.SelectionFormula = SelecForm

    ItemMaster.ItemType is Number Type. Database MS Access 2003.

    Can you help me?

    Advance Thanks,

    Regards,
    Suresh.
    www.businessobjects.com has dozens of examples.
    or here
    http://www.google.ca/search?sourceid...&q=error+20515
    Energy can be neither created not destroyed. It can only be wasted.

    Red Green

  5. #5
    Junior Member
    Join Date
    Jul 2006
    Posts
    31

    Re: Crystal Report Formula

    The example:
    VB Code:
    1. With CrystalReport1
    2.    
    3.         .ReportFileName = App.Path & "\RPTInvoice.rpt"
    4.         .WindowShowCloseBtn = True
    5.         .WindowShowRefreshBtn = True
    6.         .WindowState = crptMaximized
    7.         .WindowShowSearchBtn = True
    8.         .WindowTitle = "Invoice "      
    9.  
    10.          criteria = "{FaxOut.Bil}=" & Val(txtBil1) & ""
    11.         .SelectionFormula = criteria
    12.              
    13.         .Action = 1
    14. End With

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width