Results 1 to 2 of 2

Thread: crystal reports

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 1999
    Posts
    10

    Post

    I'm having some difficulty in passing a parameter from my vb application to the crytal report I made. I want my report to include only data that would satisfy my criteria. The problem is that I don't know how to pass a parameter from my vb application to the crystal report I made. Can any body help me how to do it.I'm using a vb6 and my crystal report is 4.6.

  2. #2
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670

    Post

    You use the SelectionFormula property of the Crystal Reports OCX control...

    1. Include the Crystal Reports OCX control on the form.
    2. In code;

    CrystalReport1.ReportFilename=[filename]
    CrystalReport1.SelectionFormula=[formula]
    CrystalReport1.Destination=[destination]
    CrystalReport1.Action=1 (to run the report)

    The selection formula has to be in the same format as Crystal Report's formula editor - the easiest way is to build the formula in Crystal Reports then copy and paste it to VB.

    Eg;

    .SelectionFormula="{tbl_Loans.LoanID} = "+cstr(MyLoanID)



    ------------------
    Mark "Buzby" Beeton
    VB Developer
    [email protected]



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