Multiple grand totals

I have a report the lists sales per customer of different products. At the end of the report, we need a grand totals list of all the products on the list. I can find how to add a grand total of the report, but not if there are multiple grand totals. An example output might be:

Customer 1

 Product A          10

 Product B          23

 Product C          5

  

Customer 2

 Product B          50

 Product D          1

 Product E          20

  

Customer 3

 Product A          99

 Product C          5

 Product E          30

  

I need to report the totals by product at the end:

Sales Totals

 Product A         109

 Product B          73

 Product C          10

 Product D          1

 Product E          50

Is a Report Summary band appropriate in this instance? If so, how do I put multiple grand totals in the report.


Thank you in advance for any help you can provide.


Jeff

Comments

  • FR doesn't have such feature, Use TStringList with Duplicates = False in the script to store and calculate totals for each category during preparing of report and then show this data in the report summary.

  • Thanks.

    My first attempt at this was to create a string list to keep the description and the accumulated totals. But I didn't know how to include the list in the report. The problem I run into is that number in the grand totals list could vary depending on the date range for which we are getting the data. If FR does not have this capablity, is there a way to show the stringlist in the report summart or report footer bands? Alternatively, can I create a second report just to display the totals and embed it into the main report?

  • Fill TfrxMemoView in TfrxReportSummary band in the script

    procedure ReportSummary1OnBeforePrint(Sender: TfrxComponent);
    
    begin
    
     Memo2.Text := sl.Text;     
    
    end;
    


  • gpi, thank you. That is just what I was looking for. I really appreciate it.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.