Home Devices
New Blog Posts: Merging Reports - Part 1 and Part 2

Export to Bitmap, problem and possible solution

edited October 2011 in Devices
Hello,
I have been having some problems when printing to a bitmap device. It
appears that each page prints over the top of the previous one. After
looking at the code for the bitmap device it seems that the image is
not cleared between pages. I have aded the following line of code to
clear the image. The change appears to work fine but could you let me
know if you feel the change will bring other unexpected problems please.

{TppBMPDevice.InitializeImage}
procedure TppBMPDevice.InitializeImage(aPage: TppPage);
begin
if FBitmap <> nil then
begin
FBitmap.Assign(nil) ; //<<<--- ADD THIS. Clear the existing
bitmap image.
FBitmap.Width := Trunc(aPage.PageDef.spWidth * FScale);
FBitmap.Height := Trunc(aPage.PageDef.spHeight * FScale);
end;
end;


Regards,
Will.


--
www.cohesis.co.uk

Comments

  • edited October 2011
    Hi Will,

    You are correct, the bitmap should reset each time the InitializeImage
    routine is called. Thank you for pointing this out.

    I will create a patch for RB 12.05 and be sure this fix is added to
    future releases of ReportBuilder.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.