Footer for MasterDataBand having two Detailbands
Hello,
I have a report (bill-calculation) with a MasterData-Band, which
has two DetailData-Bands, e.g:
MasterData: agios and disagios
DetailData1: agios
+ 100,00 $
+ 200,00 $
DetailData2: disagios
- 100,00 $
- 50,00 $
Now I want to print a footer that shows the sum of all values (agios+disagios):
"Sum 150,00$"
If I add a footer it is always assigned to the band before the footer,
in this case DetailData2. If DetailData2 is empty and only DetailData1
has data then the footer is not printed and I have no sum-row.
Therefore I need a footer for the MasterData, which
is printed below DetailData2.
How can I do that ?
Thanks
I have a report (bill-calculation) with a MasterData-Band, which
has two DetailData-Bands, e.g:
MasterData: agios and disagios
DetailData1: agios
+ 100,00 $
+ 200,00 $
DetailData2: disagios
- 100,00 $
- 50,00 $
Now I want to print a footer that shows the sum of all values (agios+disagios):
"Sum 150,00$"
If I add a footer it is always assigned to the band before the footer,
in this case DetailData2. If DetailData2 is empty and only DetailData1
has data then the footer is not printed and I have no sum-row.
Therefore I need a footer for the MasterData, which
is printed below DetailData2.
How can I do that ?
Thanks
Comments
DetailData1OnAfterPrint:
if DetailData2.DataSet.Count = 0 then
Engine.ShowBand(Footer)
I hoped to solve it without a script because scripting is difficult
to explain to our customers, who want to change reports.
(All in all FastReport is easy to use.)
Maybe you can think about the following proposals for one of the next versions:
1. The footer could get an additional property for setting the parent to which
it belongs (footer.Parent=MasterData) .
2. Now, a child-band is printed directly after the parent-band even if there are
detailbands in between. E.g the report
MasterData
DetailData1
DetailData2
Child (for MasterData)
is printed as
MasterData
Child (for MasterData)
DetailData1
DetailData2
I solution for my problem could be, if the order of the bands would be kept.
If DetailData2.PrintIfDetailEmpty is set to true then the header is printed too
although there are no disagios. If there is no header then it would be ok.
I found a another way, but not an elegant one:
Header : "Agios and Disagios"
MasterData1: agios-disagios-dataset (recordcount is always 0 or 1 - having or not having)
Header : "Agios"
DetailData1: agios-dataset
+ 100,00 $
+ 200,00 $
Header : "Disagios"
DetailData2: disagios-dataset
- 100,00 $
- 50,00 $
MasterData2: agios-disagios-dataset (same es MasterData1) : "Sum of ... [Sum]"
It seems to work, but it is difficult to explain to customers.