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

Sum of values in a Report Detail band

SitesMasstec

Programmer
Sep 26, 2010
535
Brasil
Dear colleagues:

I have a report which displays values from some records (parent + child):

relatreservas3-Totals.jpg


Now I need to calculate some total values, as shown in the above red squares.

In a Form, I displayed these total values after calculating them in the Form, Init procedure, but in a Report... I do not know what to do from this point:

relatreservas3-Sum.jpg

Of course I need the (first) variable TotalMarBR = tarimarbr + tpormarbr + tranmarbr + servmarbr

Thank you.
 
Dear colleagues:

I have a report which displays values from some records (parent + child):

View attachment 1781


Now I need to calculate some total values, as shown in the above red squares.

In a Form, I displayed these total values after calculating them in the Form, Init procedure, but in a Report... I do not know what to do from this point:

View attachment 1782

Of course I need the (first) variable TotalMarBR = tarimarbr + tpormarbr + tranmarbr + servmarbr

Thank you.
For starter, you will have to move the total variables out of the detail band.
 
You can create report variables, and do your totaling there. Then, display the variable values where you want.

That said, if you are trying to total records which are not part of the report, that gets complicated.
 
Steve: I need to display the total values in places shown. I cannot move these totals to another band.
If the totals are for each detail record then you'll have to use (tarimarbr + tpormarbr + tranmarbr + servmarbr), which I assume are data fields, instead of TotalMarBR.
To do that, insert a field type in detail band after 'Totals:' and use the expression to define the total you wanted:


Capture.PNG
 
Yes, Steve, good, it works fine. As the values are from a table, I had to explicit them:

relatreservas3-Sum2.jpg

The child table can have 5 records for this reports. And in the end there must be Grand Totals for these total values.

Total variables would be a better solution, but if it's not possible. let's do this way.

Thank you.
 
Yes, Steve, good, it works fine. As the values are from a table, I had to explicit them:

View attachment 1784

The child table can have 5 records for this reports. And in the end there must be Grand Totals for these total values.

Total variables would be a better solution, but if it's not possible. let's do this way.

Thank you.
You know you can have grand totals at the end too, correct ?
Just in case, the grand totals can be coded in group footer, outside and after detail band, in similar coding to detail band.
 
Ok, Steve, I will try to use Group Footer later.

So, I am curious about what is this "Variables" tab in the Report properties for, bellow?

relatreservas3-Sum.jpg
 
Hi,

Below a demo with 4 cursors to show how to calculate values per record(s), the group(s) footer(s) and the total on the last page footer.

hth

MarK
 

Attachments

  • Singh2.zip
    39.5 KB · Views: 1
Dear colleagues:

I have a report which displays values from some records (parent + child):

View attachment 1781


Now I need to calculate some total values, as shown in the above red squares.

In a Form, I displayed these total values after calculating them in the Form, Init procedure, but in a Report... I do not know what to do from this point:

View attachment 1782

Of course I need the (first) variable TotalMarBR = tarimarbr + tpormarbr + tranmarbr + servmarbr

Thank you.
Maybe I am missing something but if you have the totals already calculated on the form, then you don't need any report totals, just correct groupings on report and display form totals as a variables. Otherwise, you will need to create multiple groupings on the report and create report totals for each group
 

Part and Inventory Search

Sponsor

Back
Top