Board index » delphi » PaperSize = Custom Pb Please help

PaperSize = Custom Pb Please help

I'me using QuickReprt 3.07 with Delphi 5.01, when I set the paper size
Option to Custom and I define the paper size expl : 210 mm / 270 mm it work
correctly only when Orientation is 'poPortrait' but when I set the
Orientation to poLandscape the size of the printed area is not set
correctely.
so how can I avoid this pb please help
 

Re:PaperSize = Custom Pb Please help


Hi Lotfi,
For the first part of your problem ...
Not all printer drivers support the custom size through Quick Report.  You
will then have to select custom paper size in the printer driver and define
the paper. Set this to be the default paper size for the printer and
finally set the TQuickRep.Page.PaperSize property to Default. Your custom
size will now be picked up at runtime.  An alternative would be to use the
next largest paper size and set the margins to keep the printing within the
custom area.

Secondly .....
Problem's that while it works fine with the designed QuickRep's orientation
as popotrait,
it crashes if the orientation is poLandscape.  While executing the
TQuickRep.QRPrinter's CreatemetafileCanvas procedure it can't get the
PaperLengthValue because if the Orientation is poLandscape and papersize is
Default then ...
here's the code from unit Qrprntr.pas ... (as per QR Pro 3.05)

function TQRPrinter.PaperLengthValue : integer;
begin
   if Orientation = poPortrait then
   begin
      ......
      ......
   end else
   begin
     if PaperSize <> Custom then
       result := round(cqrPaperSizeMetrics[PaperSize, 0] * 10)
     else
       if PaperSize = Default then
         result := PaperWidth
       else
         result := PaperLength; // size = custom // bombs here
   end;
end;

The code should be .............. {supposedly fixed in  3.06}

function TQRPrinter.PaperLengthValue : integer;
begin
   if Orientation = poPortrait then
   begin
     if (PaperSize <> Custom) and (PaperSize <> Default) then
       result := round(cqrPaperSizeMetrics[PaperSize, 1] * 10)
     else
       result := PaperLength;
   end else
   begin
     if (PaperSize <> Custom) and (PaperSize <> Default) then
       result := round(cqrPaperSizeMetrics[PaperSize, 0] * 10)
     else
       result := PaperWidth;
   end;
end;

Quote
Lotfi ZEMALI <lot...@mail.usa.com> wrote in message news:3a1968b7_2@dnews...
> I'me using QuickReprt 3.07 with Delphi 5.01, when I set the paper size
> Option to Custom and I define the paper size expl : 210 mm / 270 mm it
work
> correctly only when Orientation is 'poPortrait' but when I set the
> Orientation to poLandscape the size of the printed area is not set
> correctely.
> so how can I avoid this pb please help

Other Threads