printing footer of an empty detail band
Hi,
I have a (master/detail) report that is supposed to print data of the master band and all records of its detail band, the latter has a footer containing some static text that should be printed regardless the detail band is empty or not
I tried the following code but no chance to get it running,
the above code is located at the beginning of the page code.
please advise,
Regards,
Raouf
I have a (master/detail) report that is supposed to print data of the master band and all records of its detail band, the latter has a footer containing some static text that should be printed regardless the detail band is empty or not
I tried the following code but no chance to get it running,
var
ds: TfrxDataSet;
begin
ds := Report.GetDataset('clearanceDs');// this is the name set in username property
if ds.recordcount = 0 then
begin
engine.showband(clearanceFtr); // this is the name of the footer that should appear at the bottom of each detail even for empty ones
end;
end.
the above code is located at the beginning of the page code.
please advise,
Regards,
Raouf
Comments
Try such a solution:
1. Add ChildBand to MasterBand and make it not Visible, and put your static text over there
2. If ds.recordcount is 0 then set this ChildBand.Visible := true and your static text will be printed naturally
3. If ds.recordcount is NOT 0 then set this ChildBand.Visible := false and print the static text from other bands
Pay attention to set MasterBand.PrintIfDetailEmpty := true.
Mick
thanks Mick,
I'll give it a try tonight as I am still at work right now, will post my comment regarding your solution very soon.
Regards,
Raul