Inherited reports in DFM does not respect "Papersize"

I have problem with reports in DFM that are inherited.

Template report (MainRep.pas) is Portrait and have page settings A4 (21x29,7).

I've created two reports that was inherited from template report.

  1. First report (Rep.pas) is the same as template report (Page setup have Page size A4 and dimensions 21x29,7)
  2. Second report (Rep_landscape.pas) is landscape (Page setup have Page size A4 and dimensions 29,7x21)

Problem is when i print report, because first report prints on A4 and everything is OK, but when I print second report, it change paper size to "Custom" (not A4) and printer can't print until I go to printer and select that I want to print that page (which is Custom and not A4) on A4 paper.

When I look in DFM files of reports:

Template report:

 object Page1: TfrxReportPage
     PaperWidth = 210.000000000000000000
     PaperHeight = 297.000000000000000000
     PaperSize = 9
     LeftMargin = 10.000000000000000000
     RightMargin = 10.000000000000000000
     TopMargin = 10.000000000000000000
     BottomMargin = 10.000000000000000000
     Frame.Typ = []
     MirrorMode = []
   end 

First report:

inherited Page1: TfrxReportPage           

end

Second report

inherited Page1: TfrxReportPage
     Orientation = poLandscape
     PaperWidth = 297.000000000000000000
     PaperHeight = 210.000000000000000000
end

I think that second report should have "PaperSize = 9" because it is still A4 page but only landscape or should read paper size from template report.

Solution is that I can explicitly set "PaperSize := 9" before print, but it would be nicer if you can fix that.

I've attached example in which you can see that when you click on "Preview" button, and in preview window on "Page Settings" the page size is "A4", but when you click on "Preview landscape" button, and in preview window on "Page Settings" then page size is "Custom".


Comments

  • G'day Sass,

    You probably would do better raising aTicket on the Support Site, since the Forums are mainly for Users.

    https://cpanel.fast-report.com/tickets

    FR Team members do come here, but may not do so soon enough for you.

    FWIW, I did raise a Ticket ages ago on Vcl 6.x about changing between A4 Portrait and Landscape (with alternating margins / guttering) but as of Vcl 2022.3 we are still relying on our own customisation of the code to make it work! And yes we make extensive use of templates and reports stored in DFM files.

    You have provided a lot of helpful data, but I didn't see anything about which version you are using... And I assume you have ruled out problems with your Printer(s).

    Cheers, Paul

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.