在网上找了一段代码,结果生成的是一个空白的bmp,(转成bmp图片也行)
客户需要将报表生成JPG图片,然后发emailprocedure 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;