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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A Pretty Basic Question... 1

Status
Not open for further replies.

JHerr

Programmer
May 25, 2001
42
US
Hello!
Ok, i created a CR based on an Access query that has two parameters: One is the user name of the person logged into the front-end app (lets call it "UserX") and the other is the record number (lets say "rec#")

All i want to do is Print the report. I figure i need to pass some parameters to it. i think i saw some code somewhere that had something close to this:

CRControl.parameter(1)= whatever

My question(s):
1. How exactly do i get it to print my report (keeping in mind that i am unfamiliar with API calls, but willing to learn :) )?
2. How do i pass the parameters?

Thanks in advance!!
-jacob
 
If you run the report from CR, doesn't Access prompt you for the parameters?

How are you launching the report? Ken Hamady
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.
 
Well,
as i'm creating it, i run it from the CR App. but its purpose will be to launch from a VB app, most likely an NT service being created for the purpose of printing many many reports at various scheduled times. I want to call the .rpt file from the app and pass the parameters. I've been looking around at various sites for various bits of code, and in the manual, but I just can't seem to grasp it. for instance, i think i'm supposed to use the CR control, not the viewer control, but again , i'm not too sure. Again, all i want is to print a premade report with a couple parameter fields from a VB app.
thanks!
-jacob
 
What version of CR are you using?

Also, you have to select an integration method. There are 4 different methods, with different capabilities and syntax. They are listed in the FAQ of the General forum entitiled "What info should I include with my question". Ken Hamady
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.
 
Ok...
1) Version 8.5
2) ODBC to access query
3) ?
4) VB6
5) OCX, API, RDC - (?)

I'll use which ever of the four methods is the best( or at least i can comprehend the best)

so far, the ocx looks easy, but its still in the air.
-jacob
 
Below is the line for filling in a Crystal parameter from your VB app, using the OCX. This assumes that you are using a Crystal Parameter field, not an MS Access Parameter Query.

rptMyReport.ParameterFields(0) = "ParamName;ValueToPass;True"

True means to skip the prompt and simply use the passed value, False would prompt with the passed value as a default. Ken Hamady
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top