Hiding page BackPicture via code

Hi all.
I'm trying to replicate a watermarking functionality for reports by showing/hiding the page's BackPicture. I need to access the page object via delphi code and toggle visibility flags.
I have tried the following methods but neither seems to be working:
  report_page := FormReport.frxReportLoader.FindObject('Page1') as TfrxReportPage;
  if report_page <> nil then
	begin
	  report_page.BackPicture.Assign(nil);
	end;
	report_page := FormReport.frxReportLoader.FindObject('Page1') as TfrxReportPage;
	if report_page <> nil then
	begin
	  report_page.BackPictureVisible := False;
	  report_page.BackPicturePrintable := False;
	end;


Thank you.

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 1:13AM
    Have you loaded the report into the tfrxreport component first before trying to modify it?
  • edited 1:13AM
    gordk wrote: »
    Have you loaded the report into the tfrxreport component first before trying to modify it?

    Yes.
    Report operations are done in the following order (batch print):

    1. load fr3 file
    2. show/hide backpicture
    3. prepare report
    4. show report
  • edited 1:13AM
    Update on the issue:

    this works
    report_page := TfrxReportPage(FormReport.frxReportLoader.FindObject('Page1'));
    

    this doesn't
    report_page := FormReport.frxReportLoader.FindObject('Page1') as TfrxReportPage;
    

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.