durumdara
durumdara

Reputation: 3493

QuickReport: QRImages vanish after the 1. page on Windows11

In our Delphi-based application, we use the QuickReport (5.x) module to print or view documents. This has worked well so far, but 1-2 months ago users reported disappearing barcodes. The first page is fine, but the images are not visible after the first page (ie from page 2). The program works fine under Windows 10.

If I launch a 1 year old app, I experience this there as well. That's why I'm sure the environment has changed. Probably caused by a Windows Update package.

I have checked many things in a simple test application. It doesn't matter if the QRImage is static or dynamic, the result is invisible on 2. page. I assume that Windows Update changed an API call - but QuickReport is old, so it calls the procedures in an older way.

Direct printing (via TPrinter) is fine. I can draw the same image or metafile on different pages, all of them are visible.

I tried changing the PrinterSettings.MemoryLimit but it had no effect.

I have no idea what to do... We haven't changed anything, yet an error occurs and they are waiting for a solution.

An additional info: If I put a normal logo (PostgreSQL Elephant) into a QRImage, it remains visible. Only Barcodes and QR codes disappear from the second page!

Has anyone experienced a similar problem? Or does anyone know what change is causing this error?

Upvotes: 0

Views: 61

Answers (1)

durumdara
durumdara

Reputation: 3493

I thought the problem is based on the old QuickReport, because the QRImage has Picture/Bitmap with correct content - but it not printed.

After much experimentation I found the source of the problem in the Barcode generator component (HanSoft).

Formerly it was enough to set the TBarcode1D_Code128 component's Image property and Barcode property only once and it printed in all pages.

But now I have to reset, and reassign the data for printing.

BC.Barcode := '';
img := BC.Image;
BC.Image := nil;
if Assigned(img) 
  then img.Picture := nil;    
BC.Image := img;
BC.Barcode := aNewBarCode;

The interesting thing that the QRImage is Enabled, contains the bitmap - but it not printed (I logged in BeforePrint event). In the preview it is visible.

On Win10 it was enough to set the BC data once.

BC.Image := QRImage1;
BC.Barcode := '1234567890';

On Win11 I have to clear and reassign the data.

But maybe this is mixed problem: QuickReport and HanSoft too, this is why I didn't delete this post.

Upvotes: 2

Related Questions