cancel
Showing results for 
Search instead for 
Did you mean: 

PrintToPrinter: A generic error occurred in GDI+ everytime

frank_corrado2
Discoverer
0 Kudos

Hi,

We've deployed a windows .net application with Crystal Reports .net 2010, version 13.0.13.1597.

The application prints 3 crystal reports. 1 out of the three don't print on specific machines, which are Windows 7, 4GB, X64. There machines are brand new.

The error message thrown when trying to print (via the PrintToPrinter Method) is:

System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.    

at System.Drawing.Graphics.CheckErrorStatus(Int32 status)   

at System.Drawing.Graphics.DrawString(String s, Font font, Brush brush, RectangleF layoutRectangle, StringFormat format)    

at System.Drawing.Graphics.DrawString(String s, Font font, Brush brush, Single x, Single y, StringFormat format)    

at CrystalDecisions.Shared.PageRender.draw_FieldObjectInstance(FieldObjectInstance fieldObject, Graphics g)

Please help!!

-F

Accepted Solutions (1)

Accepted Solutions (1)

enzo_varenna
Explorer
0 Kudos

Hi,

problem source appears to be KB3078601 August windows update: try to disinstall and see ....

frank_corrado2
Discoverer
0 Kudos

Many thanks to Enzo Varenna. This solved my issues and explains why some machines printed vs not.

Answers (1)

Answers (1)

former_member183750
Active Contributor
0 Kudos

Hi Frank

First thing I'd recommend is updating to SP 14:

Then consider what is different with the report that throws the error; subreports? Graphics? Different fonts (bar code)?

Check if the printer driver has any updates available for it.

What is the printer and driver name?

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow me on Twitter (#SAPLumira)

Got Enhancement ideas? Use the SAP Idea Place 

frank_corrado2
Discoverer
0 Kudos

Thanks for responding.

I updated the runtime on the machine to 64x for 13.0.13

And now the gdi error is gone, but we are getting out of memory on the same report. Close and dispose are invoked and app built to run on any cpu.

Any ideas?

frank_corrado2
Discoverer
0 Kudos

Exact error:

System.OutOfMemoryException: Out of memory.     at
System.Drawing.Graphics.CheckErrorStatus(Int32 status)     at
System.Drawing.Graphics.DrawString(String s, Font font, Brush brush, RectangleF
layoutRectangle, StringFormat format)   
at System.Drawing.Graphics.DrawString(String s, Font font, Brush brush,
Single x, Single y, StringFormat format)   
at CrystalDecisions.Shared.PageRender.draw_FieldObjectInstance(FieldObjectInstance
fieldObject, Graphics g)     at CrystalDecisions.Shared.PageRende

0 Kudos

So did you update to SP 14 or just install the 64 bit runtime and test again?

If updated to SP 14 did you recompile your app? There are new API's in SP 14 so it needs to be rebuilt.

Now that you are running in 64 bit mode does that printer driver support or have a 64 bit version?

Download the app I wrote in KBA 2163438, recompile in either 32 or 64 bit and see if it works. If not set and use the POC print option for the viewers print button and see if that works.

Don