sum of two dbcalc in subreports
Hi all,
I need to get a sum of two dbcalc and show it on variable1 (on summary).
One dbcalc is on Subreport2 and another is on subreport3. How can i get it ?
I'm using it on oncalc event of variable1:
value := dbcalc1.value + dcalc2.value;
but its don't works. I'm using lookahead as true.
Thanks all.
I need to get a sum of two dbcalc and show it on variable1 (on summary).
One dbcalc is on Subreport2 and another is on subreport3. How can i get it ?
I'm using it on oncalc event of variable1:
value := dbcalc1.value + dcalc2.value;
but its don't works. I'm using lookahead as true.
Thanks all.
This discussion has been closed.
Comments
When is the TppVariable actually calling its OnCalc event. Check the Timing
dialog by right clicking on the variable in the designer to find out. You
need to select the proper time to calculate in order to ensure the DBCalcs
have already been calculated and are holding the final value.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Report
-Subreport1
-Subreport2
Report Footer
Myvariable := Dbcalcvalue from subreport1 + Dbcalcvalue from subreport2
My variable don't get correct value.
DBCalc components are not particularily designed to make complicate multi
report calculations. I sould suggest replacing them all with TppVariables
in your subreports. Then inside the OnCalc of the TppVariables in the
subreports, update the value of the variable located in your report footer.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I'm using the reportbuilder 9.01 for delphi 7.
Sorry, I'm unclear about what is happening in your report. Did you follow
the instructions I suggested in my previous post? Perhaps a little more
information on how your report is set up and how you would like it to look
would help.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
another. See the atachment. The variable3 get the sum of Subreport2 and
variable4 get sum of Subreport3. There is no problem for it but now i need
sum the two variables on variable2. How can i do it ? What timing i need to
use ?
thanks,
sammy davis
For future reference, please send all attachments to
support@digital-metaphors.com.
Inside each subreport, I assume you have another TppVariable in the detail
band updating the value of Variable3 and Variable4. Why not just simply add
that value to the total value of Variable2 as well? This way Variable2 will
be accumulating the total of each subreport as they are generated.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Without success yet.
I'm using the datasetfield property from clientdataset to do the
relationship between tclientdataset's.
The report work's but i'm getting strangers results. On last record from
subreport the variable calculate two times.
Without success yet.
If possible, please send a small example demonstrating this behavior that I
can easily run on my machine to support@digital-metaphors.com in .zip format
and I'll take a look at it for you.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com