问题
I am trying to trigger a Telerik report to print once it has been rendered using either the native Silverlight printing ability or the integration with Adobe Acrobat.
In my searches I have found this forum post - http://www.telerik.com/community/forums/reporting/telerik-reporting/reporting-parameters-first-time-not-applied-when-usenativeprinting-false.aspx
Which seems to describe how to do it, but when I try this approach, using the ReportServiceClient RenderAndCacheCompleted event, I get a SecurityException if using native print support (not a user triggered event so understandable) and when trying to print using non-native, apparently nothing happens at all.
When I debug I can see the PrintReportCommand execution is failing (checking CanExecute returns false), possibly due to the ReportViewerModel state being ViewerWorkInProgressState.
It almost seems like this isn't the right event, like it's still too early to trigger the print operation at this point, but there don't seem to be any other events to indicate the report has completely rendered.
Does anyone know if there is any other way of doing this? Thanks.
来源:https://stackoverflow.com/questions/8727361/printing-from-a-telerik-silverlight-report-automatically