Setting Printer Tray Through Code

edited 8:33PM in FastReport 4.0
I am looking to set the printer tray/bin programmaticly, but it seems that the report's paper size overrides every attempt. IE. if the report's paper size is legal and I specify a bin with non-legal size paper, it will print to the legal bin. My code is as follows:

TfrxReportPage(Report.FindObject('Page1')).Bin := fBin;
TfrxReportPage(Report.FindObject('Page1')).BinOtherPages := fBin;

Report.PrepareReport(False);
Report.Print;

The report and project in question was upgraded from FR3 in which this was never a problem. I have a method in place now to resize the report as necessary, but preferably I would rather leave it up to the printer bin. Is there a way to force it to use the given bin, regardless of what size the report is?

Comments

  • gpigpi
    edited 8:33PM
    Do you get correct result when try to use this code in FR3 now?
  • edited 8:33PM
    Jerm wrote: »
    I am looking to set the printer tray/bin programmaticly, but it seems that the report's paper size overrides every attempt. IE. if the report's paper size is legal and I specify a bin with non-legal size paper, it will print to the legal bin.
    In my experience there are at least some printers which will just refuse to print, with or without error message, with a bin/paper size setting which is not correct. IIRC this is even the case when using Word and so it is a printer and not a FR issue.

    For reliable operation it seems to be imperative that FR paper size and Bin paper size match.
  • edited 8:33PM
    gpi wrote: »
    Do you get correct result when try to use this code in FR3 now?


    Yes, this code performed as desired in FR3. What I've posted above is an exact copy from the FR3 project.

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.