Subreports and TTX files

I have an ASP application that uses the CRViewer to display a report.
The report uses three subreports.
The main report and sub reports are all connected to TTX files (one for each report/subreport).
At run time I call a stored procedure (from the asp page) for each of the reports/subreports:

Main Report
--------------
spGetMainReportData

SubReports
-------------
spGetSubreport1Data 'MainReportID'
spGetSubreport2Data 'MainReportID'
spGetSubreport3Data 'MainReportID'

When I run the report the main report displays one page per record from 'spGetMainReportData', but the subreports display the same info on every page (info from the first record of the main report).

If I don't filter the sub report data with the stored procedures.
Is there any way that I can link the subreports to a value in the main report to filter the subreports so it displays the correct info on every page?
How do I do that?

Thanks for any help!
Contento1Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
mlmccConnect With a Mentor Commented:
Link subreport to main report

Open the report
Right click on the subreport
Select CHANGE SUBREPORT LINK
Select a field in the main report
Select the corresponding field in the subreport

mlmcc
0
 
frodomanCommented:
Note this will only work if you've placed your subreport inside the details or group section of your main report (if it's in the main report's header or footer section then the link will only pass the first or last record).

Make sure the subreport field you select is the parameter that's being passed to your stored procedure.  Also you'll want to select the one that looks like {?ParameterName} not the one like {?PM - ParameterName}.

HTH

frodoman
0
 
mlmccCommented:
Glad i could help

mlmcc
0
All Courses

From novice to tech pro — start learning today.