This is a migrated thread and some comments may be shown as answers.

Silent printing without ReportViewer not functioning from website

1 Answer 92 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 10 Apr 2017, 07:57 PM

Hello,

 

I have a website project that prints reports fine running locally but once loaded to a webserver it starts to throw exception "Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application."

Code I'm using to print report is:

 

    public void PrintReport(Report report, string printerName)
    {
        Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();
        InstanceReportSource instanceReportSource = new InstanceReportSource();
        PrinterSettings psettings = new PrinterSettings {
            PrinterName = printerName
        };

        instanceReportSource.ReportDocument = report;
        reportProcessor.PrintReport(instanceReportSource, psettings);
    }

 

I do need to signify exact printer to print to as well as it needs to be silent.  How come this only works locally?

1 Answer, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 13 Apr 2017, 02:20 PM
Hi Mark,

Below is a  quote from my response in your support ticket on the same question:

"The ReportProcessor will process and render the report on the server-machine. Also the print operation will occur on the server-machine, not at the client. Thus the server machine must be connected to a printer machine, which setting can be obtained automatically.
If the printer settings cannot be obtained from the server-machine, there will be raised a modal dialog, whi9ch is not allowed when you run the operation in the background. You need to provide valid printer settings or to stop the print operation until such valid printer settings are available.

If you want to print client-side without preview, please check Print a report directly at client-side without displaying it in a Viewer."


I hope this helps.


Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Mark
Top achievements
Rank 1
Answers by
Stef
Telerik team
Share this question
or