Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Passing one parameter to two commands Post Reply Post New Topic
Author Message
data_dog
Newbie
Newbie
Avatar

Joined: 17 Oct 2007
Location: United States
Online Status: Offline
Posts: 6
Quote data_dog Replybullet Topic: Passing one parameter to two commands
    Posted: 17 Oct 2007 at 7:34am
I have a problem with a report I'm creating in CR11. I am using two SQL commands to pull data from two different DBs. I have it working, but I have to use separate parameters for each command.
Is there a way to pass the same parameter to two different created SQL commands in CR11? I can create parameters for each one separately in the 'parameter list' box in the database expert, but I can't find a way to use an existing parameter in a command.
Is there a way to do this?
IP IP Logged
data_dog
Newbie
Newbie
Avatar

Joined: 17 Oct 2007
Location: United States
Online Status: Offline
Posts: 6
Quote data_dog Replybullet Posted: 19 Oct 2007 at 1:54pm
Guess I stumped the "experts".
 
Do I win a prize?  Big%20smile
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 19 Oct 2007 at 3:00pm
haha. Yes, I'm stumped! (sorry, no prize though)

I don't think it can be done. One option would be to put the report into a blank main report and this blank main report has a single parameter that gets passed to the subreport (your original report with two command objects). But I still don't think that will work b/c the parameter on the main report can only be linked to a single parameter in the subreport.

What I think I would do is create a single command object with both SQL queries in it and do the join in the command object (rather than having CR do the join on the client side). Then you can use that one parameter within the command object and pass it to both SQL queries.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
data_dog
Newbie
Newbie
Avatar

Joined: 17 Oct 2007
Location: United States
Online Status: Offline
Posts: 6
Quote data_dog Replybullet Posted: 22 Oct 2007 at 5:41am
Thanks!
 
I'll try putting both SQL statements in the same command. I'll let you know how it works out.
IP IP Logged
data_dog
Newbie
Newbie
Avatar

Joined: 17 Oct 2007
Location: United States
Online Status: Offline
Posts: 6
Quote data_dog Replybullet Posted: 22 Oct 2007 at 11:26am

Combining both commands into one didn't work. I imagine it would have worked fine if both commands were pulling data from the same database. But each command is pulling data from a different DB and Crystal 11 associates a command with a particular DB. So it errors when one command is trying to pull from two different DBs.

Thanks for the help. I guess they'll just have to settle for six parameters instead of three.

Since some people here are Crystal consultants, please suggest that parameters SHOULD be able to be passed anywhere. Even to two sql commands. It seems that forcing each command to have it's own custom parameters is a glitch that handicaps the full functionallity of Crystal.

IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 22 Oct 2007 at 11:40am
Yeah, different DBs would make everything more work. I agree that this is a necessary feature. You can add it to the New Feature Request under the General forum category. I know that the BOBJ people check out my site periodically to see what is going on here.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.