[FIX] Printing: Setting Bin

edited November 2016 in FastReport VCL 5
Hi,

we have found a small bug then your are setting up the BIN for the first page.

The code in frxPreviewPages.pas TfrxPreviewPages -> Print -> PrintPage is setting up the DEVMODE with BIN before the Printer.BeginDoc command thus ending up with a newly created DC with a default DEVMODE and default BIN.
The one created before gets lost.

So please move the code block
if not PagePrinted then
  Printer.BeginDoc;

before the code block
      if (Report.PrintOptions.PrintMode = pmDefault) then
      begin
        if (not PagePrinted) or
           (LastPaperSize <> Page.PaperSize) or
           (LastPaperWidth <> Round(Page.PaperWidth)) or
           (LastPaperHeight <> Round(Page.PaperHeight)) or
           (LastBin <> Bin) or
           (LastOrientation <> Page.Orientation) or
           (LastDuplexMode <> dup) then
        begin
          Printer.SetPrintParams(Page.PaperSize, Page.PaperWidth, Page.PaperHeight, Page.Orientation, Bin, Integer(dup) {+ 1}, ACopies);
        end else
        if (not PagePrinted) or
           (LastBin <> Bin) or
           (LastOrientation <> Page.Orientation) or
           (LastDuplexMode <> dup) then
        begin
          Printer.SetPrintParams(Report.PrintOptions.PrintOnSheet, SheetWidth, SheetHeight, Page.Orientation, Bin, Integer(dup) {+ 1}, ACopies);
          SheetWidth := frxPrinters.Printer.PaperWidth;
          SheetHeight := frxPrinters.Printer.PaperHeight;
        end;
      end;

and all is fine.

Thx in advance.

madas

PS: please let us know when the patch was applied.

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.