Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameters through VB

Status
Not open for further replies.

maitri

Programmer
Jan 11, 2003
3
0
0
CA
HI,
how can i pass parameters from vb to crystal reprt.
means i have designed a report in crystal report but i have to pass the parameter for select query from vb..
ex: i have designed a report based on EMP table and i called this report in vb.now when i run this report in VB i need to pass the EMPNO to give the report of that perticular Employ.how can i write the formula for this.
so how could i get this..please send me the code in detail
 
you only need to create an instance of crystal in vb
and attach the new recordset to the datasource and run it.
 
thanks for ur response but when i tried like this it is giving following error
"Server has not yet been opened"
what it might be..
regards
 
when i open the recordset the recordcount is -1, is that could be a problem for the above error.
how to overcome this problem
 
1. It's a PARAMETER, not a FORMULA. Add the parameter in the report and use .ParameterFields() in VB.
2. Server not opened means you have not successfully connected to the database with .LogonServer or .SetLogonInfo UNLESS you're passing an ADO recordset.
3. You can only pass an ADO recordset if you've created the report using the Active Data Driver.
4. Depending upon your VB recordset type, the record count may be -1 until you move all the way to the end of the recordset. In other words, rs.movelast, then check the record count.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top