Mastodon
Programmierung

Save QReports pages as BMP

The following code example will save You report in the “one page per BMP
file” manner.

[code lang=”delphi”]procedure TForm5.Button4Click(Sender: TObject);
var BMP: TBitMap;
StoredUnits: TQRUnit;
i: integer;
StoreDir: string;
begin
StoreDir:=”; {!!! Assign folder to store here (with ending ‘\’), leave
blank to store in the .exe’s folder}
QuickRep1.Prepare;
StoredUnits:=QuickRep1.Units;
QuickRep1.Units:=Pixels;
try
for i:=1 to QuickRep1.QRPrinter.PageCount do begin
BMP:=TBitMap.Create;
try
BMP.Width:=Round(QuickRep1.Page.Width);
BMP.Height:=Round(QuickRep1.Page.Length);
QuickRep1.QRPrinter.PageNumber:=i;
BMP.Canvas.Draw(0, 0, QuickRep1.QRPrinter.Page);
BMP.SaveToFile(StoreDir+’Page’+IntToStr(i)+’.bmp’);
finally
BMP.Free;
end;
end;
finally
QuickRep1.Units:=StoredUnits;
end;
end;
[/code]

[tags]Delphi, Printing[/tags]

0 Kommentare zu “Save QReports pages as BMP

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht.