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

Formula as Parameter in Subreport

Status
Not open for further replies.

batkosta

Technical User
Apr 11, 2006
16
GB
Dear Experts,

Is it possible to use a string formula from the main report as a command object parameter in the subreport? I'm trying to construct dynamic sql in my subreport using CRXI.


Many Thanks,

Mr. K
 
An intriguing idea...

I don't think that you can use any extrenals other than a parameter in a command object, and i think that you can ONLY use parameters as created within the command object itself.

I can see how this could allow for some very flexible coding though, and creating dynamic SQL.

In general subreports should be avoided due to decreased performance, perhaps you should post particulars about your Crystal version, the database used, example data and the expected output and get some other ideas of how to approach the requirements.

-k
 
Thanks for your immediate reply k. I'm using crystal XI with sp2 against a postgres database.

Since crystal won't let me use dynamic parameters in command objects I decided to generate these in a main report and pass them on to a subreport to see if it works. Amazingly it does.

On my main report I have few command objects used to generate few dynamic parameters. When I passed these params on to my subreport they became Pm-?MyParams in the subreport. Then i created params with the exact same name in the subreport's command object and it worked fine - only with discrete values though. Multiple values didn't work.

Then I generated a formula in the main report which creates a string like "and Product.ID in (1000,2000,3000...)" - the values in the brackets represent the parameter selection. Now when I pass the formula on to the subreport it becomes Pm-@MyFormula and the subreport is not displayed at all - even before putting it in the command object.

Hope I didn't bore you too much.



Thanks,

Mr. K
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top