Group Sub Totals at bottom of Page

edited 11:57AM in FastReport 4.0
Hi,

I am a newbie with Fast-Reports and moving from Crystal Reports

I have a simple list from a TdxMemData set that gives values from import file(s)

The report is fairly simple

<PageHeader>

<GroupHeader> grouping on the source file name

<MasterData> which list the invoice details import from the file

<GroupFooter> Showing the totals of the invoice values

<ReportSummary> Displaying the Grand Totals

<PageFooter>

I am trying to get the GroupFooter to print at the bottom of the page, so I have placed a <Child> (after or before the group footer doesn't seem to matter) band on to the form design and then on the <GroupFooter> BeforePrint event added the following:
  while engine.freespace > groupfooter1.height + pagefooter1.height do
  begin
   engine.showband( child1 )
  end;


this does move the group footer down the page, my problem is that the [SUM(<frxImportData."Amount">,MasterData1)] value is Null or zero.

How, do you get the sub totals to actually print with a value and make sure that the group footer prints at the bottom of the page.

Many thanks

Simon


Comments

  • edited 11:57AM
    Well, not sure if there is a better way of achieving this, but I have ended up creating a variable that calculates the sub total.

    So when my Master Data section prints in the OnBeforePrint event, I increase the variable
    Set( 'ReportTotal', get('ReportTotal') + <frxImportData."Amount">);
    

    My Group footer then has a text object that references the [ReportTotal] variable

    I can then use the loop in the GroupFooter1OnBeforePrint to move my groupfooter1 band to the required place
      while engine.freespace > groupfooter1.height + pagefooter1.height do
      begin
       engine.showband( child1 );
      end;
    

    then in the GroupFooter1OnAfterPrint, I reset my variable back to zero
      Set('ReportTotal', 0 );
    

    Not sure if this is best practice for Fast-Report, but it does get around the problem of my child bands printing before the group footer nulling the summary

    Would love to know if there is a check box I am missing, though to allow the simple loop only method.

    Thanks
    Simon

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.