I have a main report producing a sales invoice, I have added a sub report in order to bring in certain lines.Is there a way I can add the line totals from the sub to the main in order to get a grand total.
The general method is to use a shared variable. This example is for a date or a currency amount, but you should be able to adapt it for a count (NumVar):
Make a formula field in the subreport like
Shared dateVar
V_Today := {LoadStatus.LastDLoad}.
or
whileprintingrecords;
shared currencyvar WasSaved;
WasSaved:={#TotSaved};
WasSaved
To access it in the main report, create another formula field with
Shared dateVar
V_Today := V_Today.
or
whileprintingrecords;
shared currencyvar WasSaved;
WasSaved
But note limits - Shared variables can only be used for things that Crystal will process after the subreport has been processed. I wanted to use a subreport to find the date for data selection in the main report, but this was not allowed.
It helps to give your Crystal version, since newer versions have extra options, and some extra problems. I use Crystal 8.5.
I am also trying to show a total from a subreport on a main report. Your info is great, but I can't quite get it to work for me. I am extremely new to Crystal Reports and don't know all the ins and outs yet.
I have a main report that shows counts for new, mod and delete records grouped on customer. I also have a subreport that shows all records in the database for each customer, also grouped on customer. I have the totals for the main report in the report footer. I can't get the total for the subreport fields to show up correctly.
Ex
Customer1 New Mod Delete Total Records
Cust1 10 5 0 100
Cust2 7 3 2 200
Cust3 4 6 8 50
Totals: 21 14 10 0
The subreport is in the group footer section of the main report. I am guessing that I need to put the total for the "Total Records" in the main report. When I put it in the subreport the column looks like:
Place this on your subreport canvas instead of the count summary.
Insert a second group footer section in the main report. Create a formula in the main report and place it in the group footer_b section (this section can be suppressed):
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.