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!

Can we pass parameters to a crystal report

Status
Not open for further replies.

dummieq

Programmer
Jun 26, 2003
22
US
Hi,
At present, I have a crystal report which when invoked through an ASP page, if it requires input parameters, requests the same by sending a page with respective input fields. I want to send the parameters from the ASP page the very first time I invoke the crystal report so that the intermediate step of the application coming back and asking for input variables is eliminated. Can this be done?

Thanks for your help in advance,

regards
 
Dude,

This works in vb...shouldn't be hard to figure out in asp

Dim crParameters As craxdrt.ParameterFieldDefinitions
Dim crParameter As craxdrt.ParameterFieldDefinition

Set crParameters = yldReport.ParameterFields

Set crParameter = crParameters.Item(1)
crParameter.SetCurrentValue CStr(startdate), 12
Set crParameter = crParameters.Item(2)
crParameter.SetCurrentValue CStr(enddate), 12
Set crParameter = crParameters.Item(3)
crParameter.SetCurrentValue CStr("First Pass Yield Report"), 12

where:
yldReport is the design object
startdate and enddate are my two variables getting passed in
 
Hi,
Is there anything I should do while creating the report object which allows this feature?

Thanks a bunch
 
Dude,

This is all my code for that part

Dim yldReport As Yield
Dim db As TPDatabase
Dim rs As ADODB.Recordset
Dim crParameters As craxdrt.ParameterFieldDefinitions
Dim crParameter As craxdrt.ParameterFieldDefinition


''''set the design object called yield
Set yldReport = New Yield
''''set the ado database class
Set db = New TPDatabase
''''query my data from database
Set rs = db.getYieldInfo(startdate, enddate, False)

Set crParameters = yldReport.ParameterFields

Set crParameter = crParameters.Item(1)
crParameter.SetCurrentValue CStr(startdate), 12
Set crParameter = crParameters.Item(2)
crParameter.SetCurrentValue CStr(enddate), 12
Set crParameter = crParameters.Item(3)
crParameter.SetCurrentValue CStr("Final Yield Report"), 12
'''''set the datasource
Call yldReport.Database.SetDataSource(rs)


The problem is that u probably aren't using the designer. I don't know how to do this without this. You need to figure out how to get the craxdrt.ParameterFieldDefinitions from another place.

MJC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top