Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Subreport links to command parameters Post Reply Post New Topic
Author Message
russellhogg
Newbie
Newbie


Joined: 20 Oct 2009
Online Status: Offline
Posts: 2
Quote russellhogg Replybullet Topic: Subreport links to command parameters
     Posted: 20 Oct 2009 at 12:19pm
Hi Guys,
I'm having an issue with a subreport.  Basically I want to pass a value from my main report into a command parameter.  My command parameter doesn't show in the list when I try to set the subreport links.

As it turns out I can put the value I need to filter on in the SELECT clause and then filter my results that way.  This provides the correct results.  However it takes more than one minute per subreport.  As there are more than 100 subreports in my case this takes a large amount of time and so isn't a viable solution.

I would have expected to link to the command parameter.  Yet cannot.
CR identifies itself as version 12.

This is a similar issue I found that someone else has:
http://www.forumtopics.com/busobj/viewtopic.php?p=665622#665622

Can someone help?
Thank You,

-Russ
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 21 Oct 2009 at 6:57am
This has been my take on the Command, it is to gather information for dynamic parameter selection for the report.  Using it any other way, is not as it was designed for, and results can be unpredictable.
 
So, with that said, why to you want to go from the main report to a command, to the subreport?  Why not just the main report to the subreport, and let the subreport handle everything. The subreports selection criteria should be stringent enough.
 
In addition, as you know, subreports are a terrible use of resources. If you main report has 1 subreport and 100 records, it is 101 trips to the database.  In general, you only need 1, using a stored proc. Get all the data for the main report and the subreport and return it all on one line, then it is just a matter of display.  You might still need a subreport, but you can use the datasource of the main report, then Crystal doesn't need to pull data a second time, it's all right there.
 
In the end, the best advice is to use stored procedures, let you DB server/software do the work for you.  Let Crystal display the results.
 
HTH
IP IP Logged
russellhogg
Newbie
Newbie


Joined: 20 Oct 2009
Online Status: Offline
Posts: 2
Quote russellhogg Replybullet Posted: 21 Oct 2009 at 7:18am
I actually figured out my issue after my post yesterday.  As is so often the case.  The linking to command parameters does work.  It was just a little counter intuitive to get working.  Confusion on my part and then the type on the parameter.

As for stored procedures, I completely agree.  This is an old flat file database.  It doesn't support stored procedures.  Believe me I'd rather have done it that way.

Thanks for the reply, I am in good shape today.

-Russ

IP IP Logged
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