Page 1 of 2

Error - "No printers are installed."

Posted: Thu Jan 06, 2011 10:49 am
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?

Error - "No printers are installed."

Posted: Fri Jan 07, 2011 2:49 am
by Ivan
Hello,

Which version of Stimulsoft Reports do you use?

Thank you.

Error - "No printers are installed."

Posted: Fri Jan 07, 2011 6:54 am
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.

Error - "No printers are installed."

Posted: Fri Jan 07, 2011 9:46 am
by Jan
Hello,

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

Thank you.

Error - "No printers are installed."

Posted: Fri Jan 07, 2011 9:47 am
by marsh1n
I'll post the error shortly. I do use the RichText component.

Error - "No printers are installed."

Posted: Sat Jan 08, 2011 12:24 am
by Andrew
Ok! We waiting for the full error stack.

Thank you.

Error - "No printers are installed."

Posted: Mon Jan 10, 2011 8:35 am
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

Error - "No printers are installed."

Posted: Mon Jan 10, 2011 12:03 pm
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.

Error - "No printers are installed."

Posted: Wed Jan 12, 2011 9:04 am
by marsh1n
Any update on this?

Error - "No printers are installed."

Posted: Wed Jan 12, 2011 8:18 pm
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.