-
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.
-
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]