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

Silverlight Direct Printing

1 Answer 121 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Adam
Top achievements
Rank 1
Adam asked on 06 Jul 2011, 12:50 PM
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:
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);
        }
 
    }

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 06 Jul 2011, 04:01 PM
Hi Adam,

Currently the Silverlight report viewer doesn't expose any events related to completed rendering of report. However the ReportServiceClient exposes such event you can attach to. For more information and sample code check out the following forum thread.

Regards,
Peter
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
General Discussions
Asked by
Adam
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or