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

Linking subreport based on a stored procedure

Status
Not open for further replies.

Pejo

Programmer
Sep 18, 2001
15
GB
I have a report based on a stored procedure (Oracle 8i and CR 8.5) that has 5 parameters. It works fine. Now I want to add a subreport based on the same stored procedure (with the same parameters of course). When I try to link the subreport to the main report it gets problematic.
In the link-window I choose the 5 parameters that's in the main report so that they all are in the "Field(s) to link" box. When I then choose the first parameter and go to "Subreport parameter field to use" I can't see my parameters that's in the subreport. I only get the Crystal default parameter ?Pm-xxxx. I choose that and then go to "Select data in subreport..." and there I can't choose my parameters either.
How can I link my subreport to the main report if I can't link them together here? With the default parameters I get the parameter-values over to the subreport but I don't know how to set the sub-reports parameters equal to them.
I think I have tried everything but still haven't found a solution. Does anyone have a suggestion?

Thanks, Pejo
 
Heres the way round that I found working with ?paramx for the example...

1) Set for each ?paramx a formula field to point to ?paramx (@formulax for example)
{?paramx}

2) Change subreport links. Choose each @formulax field deselecting 'select data in subreport based on field:' for each

3)Edit subreport and change in select expert and where ever else reqd. reference to ?paramx to {?Pm-@formulax}

Hope this solves your problem.


 
Thanks for the answer, but the problem still remains as
I don't have a Selection formula because the report is based on a stored procedure. Even if I add one I still don't get anything in my subreport.
I think the selection formula is run AFTER the stored procedure and then it's kind of too late...

Any more suggestions?

/Pejo
 
I am encountering the same problem, only my DB is SQL Server 2000 (CR v8.5). Further, I have found that if I use any stored procedure in my main report, I can not link the parameters from that stored procedure to the parameters of a subreport based on a stored procedure, even if the subreport uses a different stored procedure than the one used in the main report (the subreport stored procedure parameters are not even listed in the Edit Subreport Links "SubReport parameter field to use" dropdown list).

Does anyone have a workaround for this situation, or a working example they can provide? Any help is greatly appreciated!

-Sharkbait
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top