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

Parameters to Crystal 7 (using VB6) 1

Status
Not open for further replies.

OOBIE

Programmer
Oct 29, 2002
8
US
Do any one have an example on how to pass parameters to Crystal 7 without the prompt box popping up? I am using vb6 and referencing the Crystal 7 object.

Thanks
OB
 
What line of code are you using to pass the parameter now? Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 

I am getting a recordset thru a Data Logic Layer and passing that RecordSet to Crystal....The Logic Layer
handles the parameters to the StoredProc.

Set crReport = crpapp.OpenReport(FrmPrintDialog.sRpt_form)
Set crDatabase = crReport.Database
Set crTables = crDatabase.Tables

//getting Recordset from stored Proc
Set qry = D_LogicLayer.GetFunding(strDate, strType)
// Passing Record set to Crystal
Call crTable.SetPrivateData(3, qry)
crReport.Preview

Thanks
OB


 
Is this a Crystal parameter or a stored procedure parameter?

It is unusual to have a CR parameter when you are passing a recordset, unless you are using it for formatting or a formula (in which case I would pass a formula rather than a parameter).

If this is a Stored procedure parameter to generate the recordset, it shouldn't be going through CR, since CR only sees the recordset, not the SP. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 

The CR report was built using the Stored Proc....even though I pass it the recordset CR will still popup the parameter dialog. (silly me! ) . Is there any way of undoing the CR Store Proc dependency without destroying the report?

Thanks
OB
 
Are you calling this report as an external rpt?

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
Yes ,the repor tis external the crpapp.OpenReport get a path pointing to the report.

Ob
 
Open the report in the report designer and go to:

Database - Convert Databse Driver.

What is the current driver listed? Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
OK, I am puzzled.
I don't think you can be passing a recordset to this report.

I am pretty sure that to receive a recordset the report has to use the Active Data Driver which is PdsMon.dll (Actually it is P2sMon.dll if you are in 32 bit, but it will show up as PDS. ).

Are you sure that the report is getting the recordset and not simply using saved data or running the SP on it's own? Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
Ken,
I should have taken your training course first!
I created a Data Definition (TTX) file using the fields from the Stored Proc
use the TTX file to create the reports.
then 'Call crTable.SetPrivateData(3, recordset)'

Thanks for your help
OB

 
Sounds like it works now.
Good luck. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
I am using Crystal Reports 7.0 and I need to pass parameters to a compiled version of a report which exists in the form of Exe.
I pass 3 parameters which act as the selection criteria for the report data. Instead of opening the crystal reports dialog box, for parameter asking, i want to programmatically transfer the parameters to the exe through the data that i have on my forms. Please advise the syntax and format of how i can achieve this.
 
You can't pass parameters to a compiled report.
What language are you programming in? Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
I am not using any Programming language, I am using a work flow engine and using an Active Link to the report. Since it is an Exe and i beleive we can pass parameters to an exe, was just wondering how can we pass the parameters so i can pass them, alongwith the Active Link, which happen to be on my form.
 
If the exe was created with Crystal Reports, using the "Compile Report" menu option, there is no way that I know of to pass parameters to that EXE. That EXE is not really an application but is a pointer to the Crystal Runtime Engine, which does not support external parameters in this configuration.

There are viewer programs out there that have command line options that might meet your requirements. I have all of the viewer programs listed on my web site and I know that Data Link Viewer has command line options, and I am pretty sure that one other also allows command line input.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top