Suppress printing of header and footer elements
Hi,
I would like to suppress printing of certain elements in a report header
after the first page has printed. I have tried using report.absolutepageno >
1 and setting the element visible properties to false in a beforegenerate
method. This works fine when the report is first displayed in preview but if
the user navigates forward and then back the element remains hidden.
Also I need to suppress printing of certain elements in a group footer
depending on the data printed in the detail band. Again this works fine when
first viewed but does not following report navigation in preview.
What should I do?
Thanks, Ray
I would like to suppress printing of certain elements in a report header
after the first page has printed. I have tried using report.absolutepageno >
1 and setting the element visible properties to false in a beforegenerate
method. This works fine when the report is first displayed in preview but if
the user navigates forward and then back the element remains hidden.
Also I need to suppress printing of certain elements in a group footer
depending on the data printed in the detail band. Again this works fine when
first viewed but does not following report navigation in preview.
What should I do?
Thanks, Ray
This discussion has been closed.
Comments
In my testing with the following code in the HeaderBand.BeforeGenerate
event, the test label was properly hidden for the first page regardless how
I navigated the entire report. Try placing a break point in the event in
your application and see if you can find out what is happening when you
navigate backward to cause this issue.
ppLabel1.Visible := ppReport1.AbsolutePageNo > 1;
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
The following code worked:
Label1.visible := Report.AbsolutePageNo = 1;
Variable1.visible := Report.AbsolutePageNo = 1;
However, the code I was using caused the elements to be hidden at all times
after the first pass::
if Report.AbsolutePageNo > 1 then begin
Label1.visible := false;
Variable1.visible := false;
end;
Regards, Ray
The reason for this was that you were never setting the label and variable
back to Visible := True. Something like the following would fix the
issue...
if Report.AbsolutePageNo > 1 then begin
Label1.visible := false;
Variable1.visible := false;
end
else
begin
Label1.Visible := True;
Variable1.Visible := True;
end;
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com