Obtaining information from a subreport's ppDBVariable for the main detail band.
Hi,
Please bear with me. I'm not entirely sure how to express this in writing.
I have a report with a subreport in it. The reports layout is effectively
- Header
- Detail Band
- Sub Report 1
- Sub Report 2
- Region1
- Footer
In the main Detail Band, under the 2nd Sub Report I have a region. In
this region I have a ppVariable. In SubReport2 I have a total sum of the
values in that sub report.
I would like to obtain the value from the Subreports total variable, and
use it within part of a calculation for a ppVariable located within Region1.
The problem I am facing is that the calculation for the ppVariable
appears to fire before the SubReport is printed - so any calculations
made are using values from the previous detail bands SubReports. (It's
'out by 1').
I seem to be able to overcome the problem by putting in a third Sub
Report, and by putting in my TppVariable component in there - but I
can't seem to use the component at the original Detail Bands level.
I have tried changing the CalcType and CalcComponent properties to
numerous settings without being able to achieve what I am attempting. I
attempted to use a Group, but that didn't help either.
I was just wondering if this is possible to do without using a third sub
report?
Thanks & Regards
Adam.
Please bear with me. I'm not entirely sure how to express this in writing.
I have a report with a subreport in it. The reports layout is effectively
- Header
- Detail Band
- Sub Report 1
- Sub Report 2
- Region1
- Footer
In the main Detail Band, under the 2nd Sub Report I have a region. In
this region I have a ppVariable. In SubReport2 I have a total sum of the
values in that sub report.
I would like to obtain the value from the Subreports total variable, and
use it within part of a calculation for a ppVariable located within Region1.
The problem I am facing is that the calculation for the ppVariable
appears to fire before the SubReport is printed - so any calculations
made are using values from the previous detail bands SubReports. (It's
'out by 1').
I seem to be able to overcome the problem by putting in a third Sub
Report, and by putting in my TppVariable component in there - but I
can't seem to use the component at the original Detail Bands level.
I have tried changing the CalcType and CalcComponent properties to
numerous settings without being able to achieve what I am attempting. I
attempted to use a Group, but that didn't help either.
I was just wondering if this is possible to do without using a third sub
report?
Thanks & Regards
Adam.
This discussion has been closed.
Comments
this article:
http://www.digital-metaphors.com:8080/RAP/Calculations/How_To...Access_Subreport_Values_in_the_Main_Report
?
No - that looks like it relates to RAP? (Where components added to a
Subreport are not available to the main report).
In my instance, it appears as though the components are available - and
I can access them, but they appear to be one record 'out'.
Cheers
Adam
The calculations for each variable (OnCalc event) are going to fire
before the band itself generates. This means that the OnCalc event of
your TppVariable inside the main report's detail band will fire before
the subreports generate.
To ensure the subreport executes before the outside variable, you will
either need to use another subreport (as you mentioned) or place the
variable in another band (group footer, footer, or summary).
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Thanks for the clarification. Good to know that I'm using the correct
method.
Have a great day
Adam.