TFlexCelPrintDocument

Hi,

One of our customers sent me a weird result from report:

https://consulteco.cz/screen/1564674010.png

Left one is directly printed using TFlexCelPrintDocument
, Right One is printed from export to Excel.
Export to pdf and print works as expected as well.

Both documents printed on same printer and PC, so
I don't think missing fonts is the problem.

Any Idea ?


Hi,

While I am not 100% sure on what is happening, normally this kind of problems are because FlexCel uses GDI+ to print and Excel uses GDI. Some printers don't support GDI+ very well, and can have results similar to the one you are seeing. 

So, the first thing to try would be to update the printer drivers. This seems like a random recommendation, but most of the similar cases I've seen have been actually solved by updating the drivers. So give it a try first. If the printer has firmware that can be updated, look at that too.

If the drivers are the latest or updating them doesn't work, the other option is to set PrintDocument.PrintAsBitmap := true
http://www.tmssoftware.biz/flexcel/doc/vcl/api/FlexCel.Render/TFlexCelPrintDocument/PrintAsBitmap.html

But don't do this in the general case, since printing as a bitmap gets worse results than printing directly, and it much slower. Printing as bitmap should be an option only for the cases when the printer doesn't work.

Remember also to check the dpi if printing as a bitmap as mentioned in the PrintAsBitmap docs. A higher dpi will result in better results, but also a bigger bitmap being transmitted, which is slower.

Hi,

As this is customer,
I can just recommend update drivers
and add option to setup print as bitmap.

Suppose there is no option to switch from GDI + to GDI while printing ?

Sorry, right now there is no possibility to have an option to print via GDI. The graphics engine in FlexCel is independent from the rest of the code, so we have engines for GDI+ (windows), CoreGraphics (iOS and macOS), Android, and Skia (for linux). It should be possible to do a GDI engine, but GDI has the issue of not being resolution independent, and really no advantages except for some cases like this in printing. 


Upgrading the drivers has worked in most cases similar to this one I've seen. If not, printing as a bitmap is another option, or exporting to pdf and then printing the pdf.

Ok, thanks for quick reply