Can sub-report parameters vary by main report values per page?

D

Dean Slindee

I have a main report that prints one client per page, multiple pages per
run. Inside the main report are two sub-reports that derive three parameter
values from the text of the main report. The rows shown in the sub-report
must vary by the parameter found on each page of the main report. This
setup is "working", producing report pages, but the sub-report data is from
the first client only. The same sub-report data rows appear on the first
and all subsequent client report pages.

Problem: the parameters for the sub-reports do not appear to be varying with
the changing values on the main report.

The main report and the sub-reports each use an individual stored procedure
as the data source (one stored procedure for each report, each stored
procedure is parameter driven (.adp project).

rptJusticeClientProgramCourtDate is the name of the main report.

Here is the set of three parameters as specified on the parameter line for
both of the sub-reports:
Reports!rptJusticeClientProgramCourtDate!ClientID,
Reports!rptJusticeClientProgramCourtDate!WeekDate,
Reports!rptJusticeClientProgramCourtDate!NextCourtDate

Can anyone tell me whether the subreport data can be programmed to vary with
the data on the main report, page for page? Or, are subreport parameters
"static" for the run?

Thanks in advance

Dean Slindee
 
M

Marshall Barton

Dean said:
I have a main report that prints one client per page, multiple pages per
run. Inside the main report are two sub-reports that derive three parameter
values from the text of the main report. The rows shown in the sub-report
must vary by the parameter found on each page of the main report. This
setup is "working", producing report pages, but the sub-report data is from
the first client only. The same sub-report data rows appear on the first
and all subsequent client report pages.

Problem: the parameters for the sub-reports do not appear to be varying with
the changing values on the main report.

The main report and the sub-reports each use an individual stored procedure
as the data source (one stored procedure for each report, each stored
procedure is parameter driven (.adp project).

rptJusticeClientProgramCourtDate is the name of the main report.

Here is the set of three parameters as specified on the parameter line for
both of the sub-reports:
Reports!rptJusticeClientProgramCourtDate!ClientID,
Reports!rptJusticeClientProgramCourtDate!WeekDate,
Reports!rptJusticeClientProgramCourtDate!NextCourtDate

Can anyone tell me whether the subreport data can be programmed to vary with
the data on the main report, page for page? Or, are subreport parameters
"static" for the run?

I think they are static. The standard way to filter a
subreport is to use the Link Master/Child Fields properties,
but that doesn't allow for non equal comparisons.
 
D

Dean Slindee

I am wondering if there is some way that I can link the subreport to the
main report, say by mutual ClientID. The problem seems to be that the main
report and the subreports are not "linked". If they were linked, then the
content of the subreport could be limited to the ClientID found in the main
report.

The subreports have stored procedures as datasources. This is because the
content of the subreports must be selected by a pair of dates (date range)
and one other column value. If the subreport could show all rows in the
underlying table, then stored procedures would not be needed, and "linkage"
between the reports would solve the problem. However, because the tables
being queried by the stored procedures contain lots of "unwanted" rows, a
Select statement is necessary.

Any further thoughts?
Dean Slindee
 
M

Marshall Barton

Dean said:
I am wondering if there is some way that I can link the subreport to the
main report, say by mutual ClientID. The problem seems to be that the main
report and the subreports are not "linked". If they were linked, then the
content of the subreport could be limited to the ClientID found in the main
report.

The subreports have stored procedures as datasources. This is because the
content of the subreports must be selected by a pair of dates (date range)
and one other column value. If the subreport could show all rows in the
underlying table, then stored procedures would not be needed, and "linkage"
between the reports would solve the problem. However, because the tables
being queried by the stored procedures contain lots of "unwanted" rows, a
Select statement is necessary.


Unless you want a different date range on each instance of
the subreport, you should be able to use the query's where
clause just for the dates. Then you can use the subreport
control's Link Master/Child Fields properties to link on the
ID field.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top