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

Getting sub report data to main report page header

Status
Not open for further replies.

cifjha

Technical User
Mar 9, 2004
6
0
0
SE
CR10

Hi,
My problem is that all detail fields in my main report are filled with sub reports and I have different page headers to all sub reports.

What I want to do is to count the number of records in the sub reports and send this number "back" to the page header in the main report so that I can print it on the top of the same page as I print the details of the sub report.

I know that I can't send shared variables "back" in the report so what I tried to do is to count (using SQL) the number of records in the following sub report while still writing the current sub report and then send this number out to the main report to the page header so that this is ready to use as I go in to the sub report where I want to use it. (I hope this makes some sense to you).

This would work if I only could use parameters in my sql-querys. I need to use the two groups that I have in my main report to select the right values. These groups are already sent to the sub reports via "Subreport links".

My question is:
1) How do I use parameters in SQL-querys
2) Is there any other way to solve my problem?

Thanks!!
/J
 
Unfortunately you will NOT know the number of rows prior to running the subreport, so you'll have to run the subreport twice to determine this.

In general, subreports are a bad idea, so try to offload this work to a more efficent View or Stored Procedure.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top