Data Connectivity
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Data Connectivity
Message Icon Topic: Use Link parameter in subreport SQL command? Post Reply Post New Topic
Author Message
Titus
Newbie
Newbie


Joined: 20 Oct 2010
Location: United States
Online Status: Offline
Posts: 2
Quote Titus Replybullet Topic: Use Link parameter in subreport SQL command?
    Posted: 20 Oct 2010 at 7:49am
I am trying to modify a Crystal Report to speed it up.  The report has several subqueries and I could speed them up if I can include the link parameter value in the SQL query.
 
The SQL command window/editor shows the begin and end date parameters defined in the subreport but does not list the link parameter.  I tried using the {?Pm-command.ID_NUM} parameter in the SQL even though it wasn't listed, but got a SQL error from that.
 
I tried creating a parameter IDNUM and setting the default value to the link parameter value, but that didn't work either.
 
Is it possible to pass a value from the main report to a subreport and have that value included as a parameter in a SQL command?
 
If so, how do I do that?
 
I am using Crystal Reports XI. (not R2)
 
Thanks for any help anyone can provide, even if it just to confirm that it can't be done.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 22 Oct 2010 at 5:07am

I'm not sure whether this will work, but it's worth a try.

1.  Make note of the exact names of your link parameter(s).  Then delete all links.
 
2.  In your command, create parameters with the same names as the link parameters that you deleted.  Use these in the where clause in your subqueries.
 
3.  Recreate the links from the main report.
 
-Dell
IP IP Logged
Titus
Newbie
Newbie


Joined: 20 Oct 2010
Location: United States
Online Status: Offline
Posts: 2
Quote Titus Replybullet Posted: 18 Feb 2011 at 7:05am

hilfy,

Sorry it took me so long to get back.  I tried this, but it didn't work.  Then I got dragged off on another project and when I came back I didn't have time to play around with this anymore.  Since the report was working and not taking TOO long to run, I applied the "if it ain't broke, don't fix it rule" and moved on.
 
I recently had a chance to tinker with trying to get this to work on a simple scratch build report designed to try to get this to work.  I tried this and a couple of variations, but could not get it to work.
 
If I had my druthers, I would be using stored procedures and packages to generate the data for these more complex reports.  But that is not currently an option.
 
Thanks.
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.031 seconds.