Error - "No printers are installed."

Stimulsoft Reports.NET discussion
marsh1n
Posts: 6
Joined: Thu Jan 06, 2011 10:46 am

Error - "No printers are installed."

Post by marsh1n »

I am evaluating the .net components. I am running the report in my asp.net application. When i try to export a report, I get the following error:

"No printers are installed."

Here is the code I am using:

Dim oStream As New MemoryStream
Dim TheReport As New Reports.Report

TheReport.Render()
TheReport.ExportDocument(StiExportFormat.Pdf, oStream)


The error occurs on the last line of code.

Any ideas?
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Error - "No printers are installed."

Post by Ivan »

Hello,

Which version of Stimulsoft Reports do you use?

Thank you.
marsh1n
Posts: 6
Joined: Thu Jan 06, 2011 10:46 am

Error - "No printers are installed."

Post by marsh1n »

I have Stimulsoft Reports.Net 2010.3 Trial.

Just a little more information, this only happens when you use IIS as the web server. It does not happen with the ASP.NET development server., which is what the samples use.

I did a little more research and found out it has to do with the IIS account not having access to printers. I believe there are workarounds which involve making registry changes.

Does the export code actually need a printer installed?

Thanks.
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Error - "No printers are installed."

Post by Jan »

Hello,

Can you show full error stack for this problem? Did you use RichText component in your report?

Thank you.
marsh1n
Posts: 6
Joined: Thu Jan 06, 2011 10:46 am

Error - "No printers are installed."

Post by marsh1n »

I'll post the error shortly. I do use the RichText component.
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Error - "No printers are installed."

Post by Andrew »

Ok! We waiting for the full error stack.

Thank you.
marsh1n
Posts: 6
Joined: Thu Jan 06, 2011 10:46 am

Error - "No printers are installed."

Post by marsh1n »

Here is the full error stack trace:


[InvalidPrinterException: No printers are installed.]
System.Drawing.Printing.PrinterSettings.GetHdevmodeInternal() +190805
System.Drawing.Printing.PrinterSettings.CreateDeviceContext(PageSettings pageSettings) +55
System.Drawing.Printing.PrinterSettings.CreateMeasurementGraphics(PageSettings pageSettings) +9
System.Drawing.Printing.PrinterSettings.CreateMeasurementGraphics() +11
Stimulsoft.Report.StiReport.get_GlobalRichTextMeasureGraphics() +92
Stimulsoft.Report.Components.StiRichText.RenderMetafile() +83
Stimulsoft.Report.Export.StiPdfExportService.AssembleRtf(StiComponent component) +58
Stimulsoft.Report.Export.StiPdfExportService.ExportPdf(StiReport report, Stream stream, StiPdfExportSettings settings) +9162
Stimulsoft.Report.StiReport.ExportDocument(StiExportFormat exportFormat, StiExportService exportService, Stream stream, StiExportSettings settings) +9048
Stimulsoft.Report.StiReport.ExportDocument(StiExportFormat exportFormat, Stream stream) +12
Report.Page_Load(Object sender, EventArgs e) in C:\VSS\TCO_Self_Service\Report.aspx.vb:52
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Error - "No printers are installed."

Post by Jan »

Hello,

Richtext component have installed WYSIWYG property to true? Richtext use printer canvas for special metafile rendering. This mode work only when WYSIWYG property of Richtext equal to true. Printer canvas used for avoiding strange bug of MS realization of drawing Richtext to metafile (Richtext with high resolution can be draw only on printer canvas).

Thank you.
marsh1n
Posts: 6
Joined: Thu Jan 06, 2011 10:46 am

Error - "No printers are installed."

Post by marsh1n »

Any update on this?
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Error - "No printers are installed."

Post by Ivan »

Hello,

We made some improvements in that direction.
Please check the next prerelease build when it will be available and let us know about the result.

Thank you.
Post Reply