PageFooterBand is working at one record later tthan Masterband

Hello.

Are trying to make an Invoice report.

I have a MasterBand connected to the qry Payers.
Then a DetailBand wih details of what they are paying for, in qry OrderDetails.
After that I have a PageFooterBand with FooterAfterEach and components showing the same queries
and fields as the MasterBand. (Components are in design time copied from the MasterBand to the PageFooterBand)
If I print only one invoice, the data in the MasterBand components and the PageFooterBand components
are the same.

When I print the whole query, then it starts with the MasterBand components printing the first record,
but the same components on the PageFooterBand is printing the second record, and so through the whole table
to the end, where the PageFooterBand components is printing the same record twice.

Any suggestion appreciated.

(I want the both set of components to print from the same record, also when printing them all.

[img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> Kai Inge[/img]

Comments

  • edited 3:34PM
    The field in your PageFooter will always print the value for the current record. FastReport do a DataSet.Next to navigate in all the data when printing your DataBand.

    When you only have one record, it stays on the same record after the DataSet.Next so the data in the PageFooter is the same as the data in the header. When printing multiple records, the DataSet.Next navigate to the next row of data, so the data in the PageFooter is not the same as the data in the header.

    To solve your problem, I see two options.

    1) You can use a different band type, like a GroupFooter. To be able to use a GroupFooter, you need a GroupHeader to define the break condition. If you don't want to see it, put his height to 0. It is possible to force a static position to a band, but it is a bit more complex.

    2) You can store the value that you want to show on the PageFooter in a variable on the event of your choosing (ie: BeforePrint of the DataBand).
  • PatF wrote: »
    The field in your PageFooter will always print the value for the current record. FastReport do a DataSet.Next to navigate in all the data when printing your DataBand.

    When you only have one record, it stays on the same record after the DataSet.Next so the data in the PageFooter is the same as the data in the header. When printing multiple records, the DataSet.Next navigate to the next row of data, so the data in the PageFooter is not the same as the data in the header.

    To solve your problem, I see two options.

    1) You can use a different band type, like a GroupFooter. To be able to use a GroupFooter, you need a GroupHeader to define the break condition. If you don't want to see it, put his height to 0. It is possible to force a static position to a band, but it is a bit more complex.

    2) You can store the value that you want to show on the PageFooter in a variable on the event of your choosing (ie: BeforePrint of the DataBand).

    I will try solution 2 and see if I can manage the data that way, but it's seems a bit peculiar that Fast Report do not directly allow to print data from the Masterband whereever needed on a page, without having to use workarounds as this?
    I would believe this is a daily need in reports.
    A single footer databand designed for this, that is not affected by the dataSet.next command seems mandatory to me, so why does it not exist in an advanced tool like Fast Report I don't understand. :-)

    Thank you for the solution.
    If I fail to use it, I will be back. :-)

    [img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> Kai Inge[/img]
  • edited 3:34PM
    The GroupFooter is the clean way to do it. It takes less than two minutes to configure and it works as a charm. The reason why I even suggested the option #2 is because you said you wanted to put this information in a page footer.

    However, I do agree that it would be more simple if they had a footer band that can print after the details.

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.