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

Open Print Dialog

3 Answers 206 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
WombatEd
Top achievements
Rank 1
WombatEd asked on 25 Jan 2011, 01:45 AM
I have a ReportViewer with a report on a web page.  I want to programmatically open the print dialog.  Can I do this?

3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 26 Jan 2011, 05:33 PM
Hello WombatEd,

Check this help article for more information on your inquiry.

Greetings,
Peter
the Telerik team
Get started with Telerik Reporting with numerous videos and detailed documentation.
0
WombatEd
Top achievements
Rank 1
answered on 26 Jan 2011, 05:43 PM
Peter,
Sorry if I didn't make it clear, but I don't want to "print report on client machine without showing the report".  I want to show the report and then force the Print dialog to open.
Am I missing something?
0
Peter
Telerik team
answered on 27 Jan 2011, 04:27 PM
Hello WombatEd,

The article shows in general how to invoke PrintReport() in JavaScript. In order to show a report and then invoke print dialog check out the following code snippet:

<telerik:ReportViewer ID="ReportViewer1" runat="server" Report = "MyReports.Report1
MyReports, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
/>
<script type="text/javascript">
    ReportViewer.OnReportLoadedOld = ReportViewer.OnReportLoaded;
    ReportViewer.prototype.OnReportLoaded = function()
    {
        this.OnReportLoadedOld();          
        <%=ReportViewer1.ClientID %>.PrintReport();
    }
</script>


All the best,
Peter
the Telerik team
Get started with Telerik Reporting with numerous videos and detailed documentation.
Tags
General Discussions
Asked by
WombatEd
Top achievements
Rank 1
Answers by
Peter
Telerik team
WombatEd
Top achievements
Rank 1
Share this question
or