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

Can parameter values be assigned programmatically?

Status
Not open for further replies.

kubu

Programmer
Jan 10, 2001
23
US
My report (CRXI) uses a command object with start date and end date parameter fields. I have CR functions that calculate these dates based on the current date. Is it possible to assign the results of these functions to the parameter fields at runtime? If so... how?

Thanks!
Mark
 
Made a call to BusinessObjects support and found a workable solution.

The short answer: you cannot use a CR formula or function to populate a parameter field in the same report, because Crystal executes the SQL query before it evaluates the report formulas. This makes perfect sense, but my brain was in "Monday" mode...

Anyway, here's the workaround, if anyone is interested:

[1] Create a report that returns a single piece of data from a datasource (I'm using an XML file).

[2] Place the data field in the detail section, and hide it.

[3] Create the formulas needed to generate the values to be passed to the parameter fields.

[4] Insert the "real" report as a subreport in the main report footer.

[5] Use the Subreport Links wizard in the Edit menu to link each formula field in the main report with the matching parameter field in the subreport.

Mark
 
Or create a View on the database using the same syntax as your Command Object.

Then use conventional Crystal parameters including multiple value parameters, which the BO solution can't provide.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top