Hi,
Ive found some articles here to help with printing directly in silverlight without displaying a preview. (Basically a hidden reportviewercontrol).
I am trying to render a report and then directly print. How can I tell when the report is render complete? I dont see any events on the reportviewer to tell me this.
I am essentially trying the following:
Ive found some articles here to help with printing directly in silverlight without displaying a preview. (Basically a hidden reportviewercontrol).
I am trying to render a report and then directly print. How can I tell when the report is render complete? I dont see any events on the reportviewer to tell me this.
I am essentially trying the following:
private
void
radButton1_Click(
object
sender, RoutedEventArgs e)
{
reportViewer1.UseNativePrinting =
false
;
reportViewer1.Report =
null
;
reportViewer1.Report =
"TelerikNoPreview.Web.Report1,TelerikNoPreview.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
;
// Wait for complete here
// The following would be nice in a RenderCompleted event handler if one existed
var layoutRoot = (FrameworkElement)VisualTreeHelper.GetChild(reportViewer1, 0);
var viewerModel = (ReportViewerModel)layoutRoot.DataContext;
var printCommand = viewerModel.PrintReportCommand;
if
(printCommand.CanExecute(
null
))
{
printCommand.Execute(
null
);
}
}