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

Printing reports from Silverlight Report Viewer

1 Answer 93 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Lance
Top achievements
Rank 1
Lance asked on 09 Dec 2010, 01:01 AM
Hi,

Can someone please advise me how I can achieve the following:

I have a report whose page orientation is landscape.  I want to print it from my in-browser (IE8) Silverlight 4 application.  I want the print dialog button to appear so the user can choose a printer or change defaults, but I want the report to print in landscape by default (unless the user specifically changed this in the print dialog) and not print according to the printer's defaults. 

If I set UseNativePrinting to false then nothing happens when I press the Report Viewer's print button.  If I create my own button with the following code executing on the click event :
var reportViewerModel = reportViewer.DataContext as ReportViewerModel;
if (reportViewerModel.State.Equals("ViewerPageState"))
{
   reportViewerModel.PrintReportCommand.Execute(null);
}
nothing happens.

This should be easy.  Please help.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 14 Dec 2010, 09:46 AM
Hello Tim English,

In Q3 2010 we introduced native Silverlight print, which is set as default. However the Silverlight document print has very limited API which does not allow for us to specify the orientation. Thus for in browser applications we have exposed UseNativePrinting property for the Silverlight viewer - please set it to false. This will force the Silverlight Report Viewer to revert to the previous printing behavior using the Adobe's plug-in. Note however that  this would not work for out of browser applications.

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