Hi,
I have a problem when I try to print report in controller. The thing is; it is working locally but when I deploy the project to iss I am getting error message says; "System.InvalidOperationException: No or invalid printer error on IIS server."
// Obtain the settings of the default printer
System.Drawing.Printing.PrinterSettings printerSettings
= new System.Drawing.Printing.PrinterSettings();
// The standard print controller comes with no UI
System.Drawing.Printing.PrintController standardPrintController =
new System.Drawing.Printing.StandardPrintController();
// Print the report using the custom print controller
Telerik.Reporting.Processing.ReportProcessor reportProcessor
= new Telerik.Reporting.Processing.ReportProcessor();
reportProcessor.PrintController = standardPrintController;
Telerik.Reporting.TypeReportSource typeReportSource =
new Telerik.Reporting.TypeReportSource();
//// reportName is the Assembly Qualified Name of the report
//typeReportSource.TypeName = reportName;
// Create a new report source pointing to report definition
var reportSource = new UriReportSource();
reportSource.Uri = entity.ReportName;
foreach (var i in entity.Parameters)
{
reportSource.Parameters.Add(new Parameter(i.Key, i.Value));
}
reportProcessor.PrintReport(reportSource, printerSettings);
return null;
Please suggest,
Thanks