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!

Subreport linking 1

Status
Not open for further replies.

RobHVB6Sql

Programmer
May 20, 2002
77
AU
BACKGROUND: (Using CR 8.5)
I have a report that uses two stored procedures, one for the main part of the report and one for the subreport link.
One parameter:
Code:
‘@RequestID’
from the main report is used to select info for the subreports, this link is working fine. :)

THE QUESTION: How do I set a secondary parameter for each subreport link?, I know what this will be. Ie section 1 the parameter is ‘1’ etc.
Each instance of the subreport is in its own details section, so could I hide this value in each report section?

The user is being asked for these secondary parameter values. I don’t want them to be asked anything as the report is being sent the main parameter ‘@RequestID’ from a VB application which is all the report should need.

Also are there any options I need to change for refreshing?
I want to make sure the subreports are working on ‘@RequestID’ each time it is run.


Rob Hasard
(VB6 /SQL 7.0 /CR8.5)
 
A bit confusing because you are not providing necessary detail such as what/where/why in relation to the 2nd parameter.

Does the Stored Procedure require 2 parameters? If so, then you either need to remove that 2nd parameter or feed it a value. If it's in the subreport Stored Procedure, then you feed it a value by specifying a 2nd link from the main report to the subreport.

hth,
- Ido

Visual CUT & DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Thanks.

SOME MORE DETAIL:

The sp for the main report pulls from a cancer returns table 'WACRResponses'. The sp for the subreports pulls from a subsequent 'WACRResponsesPathInfo' table which can have 0 to 6 rows (Pathology Reports) related to the row in the WACRResponses (or main) table. They are linked by an equi-join on the field 'RequestID', which is used as a parameter for the main sp and linked to the sp for the subreport instances.

I'm trying to show all details, ie the main info plus 0 to 6 pathology reports.

PARAMETERS (the problem):

I have created 6 detail sections labelled Path1, Path2 etc. Each has a subreport instance which need two parameters:
1)the RequestID - link is fine
2)PathNo - which is not supplied by the main sp.
PathNo will be constant, ie the section headed 'Path3' and will be surpressed if the path3info (from the main sp) is blank. I need to link/send the integer '3' in this case which is not in delivered in any sp.



Rob Hasard
(VB6 /SQL 7.0 /CR8.5)
 
Create 6 simple (constant) formulas (Path1, Path2, ...) that return the numbers 1, 2, 3, ...

In each of the 6 detail sections, use the corresponding formula as the 2nd link for the subreport.

hth,
- Ido

Visual CUT & DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Great thanks. I actually solved it in another way, but your solution is more versitile as it is within the Crystal Report.


My cheat = Add six columns to the stored procedure which return the value and use this as the second sub report link.

Here's a star ;-)

Rob Hasard
(VB6 /SQL 7.0 /CR8.5)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top