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

Eliminate or bypass parameter prompt through VB code? 2

Status
Not open for further replies.

ITdev

Programmer
Aug 6, 2001
25
US
Does anyone know how I can stop the parameter prompt from appearing through Visual Basic? I am passing parameter values through the paramter fields but don't want the parameter prompt to appear. Thanks in advance.
 
To disables parameter prompting in VB so the user won’t be prompted for a value.
'CRXReport is report object in Report Design Component(RDC)
CRXReport.EnableParameterPrompting = False
 
Syntax depends on which integration method you are using ( faq149-237 )
Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Also, what line of code are you currently using to pass the parameter. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Thank you for your response to my question. I apologize if I wasn't clear. Your FAQ was helpful on clarifying my question. Here are some more info...
The version of Crystal Reports I am using is 8.0. It connects to an access 2000 database through database files. My visual basic project includes printing three crystal reports one after another. I am passing a parameter from VB so that the title and other sections can be displayed dynamically on crystal report.
Here's my code:
CrystalReport1.Destination = crptToPrinter
CrystalReport1.ReportFileName = "C:\report\campus.rpt"
CrystalReport1.ParameterFields(0) = "Campus;" & strCamp
CrystalReport1.Action = 1

CrystalReport1.Destination = crptToPrinter
CrystalReport1.ReportFileName = "C:\report\grades.rpt"
CrystalReport1.ParameterFields(0) = "Grades;" & strGrd
CrystalReport1.Action = 1

The problem is that the parameter dialog box would prompt the user each time (3 times) before printing. The parameter serves no other use except for display. I am trying to find a way to avoid the parameter prompt so that the 3 reports would go directly to the printer.

I am using VB 6.0 with crystal report control as a components.

Do you know if there is a way to code this from VB so that crystal report would print without displaying a parameter prompt?

I have looked at the RDC. I have never use it and will experiment with it. Is there another method to avoid the parameter without RDC?

Thanks in advance.

Tiffany
 
CrystalReport1.ParameterFields(0) = "Campus;" & strCamp & ";true"
 
Balves is correct, the third argument is what tells it to skip the prompt (FALSE, the default, would mean keep the prompt). Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
I appreciate your help and response. I can't believe it was that simple. I was reading the Crystal report 8 complete reference and didn't even notice the "true" or "false". #-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top