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

How to disable toolbar in silverlight viewer?

1 Answer 85 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Uwe Bach
Top achievements
Rank 1
Uwe Bach asked on 24 Jun 2011, 07:41 PM
I need a seemless integration of silverlight in our own application.
The problem ist that the ViewModel property of the ReportViewer is private.
I have no chance to save a file with own workflow without clicking the toolbar.

How to to disable toolbar bar? how to export and navigate with own controls?

kind regards


1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 27 Jun 2011, 09:06 AM
Hello Stefan,

The Silverlight Report Viewer is a template that can be edited to fit your needs, for more info refer to Creating Style in Expression Blend help article.
As for manually exporting/printing from your own UI here is an example. Create an extension class in which you get the viewerModel and use the corresponding commands:

static class ReportViewerExtensions
   {
       public static void PrintReport(this ReportViewer reportViewer)
       {
           var layoutRoot = (FrameworkElement)VisualTreeHelper.GetChild(reportViewer, 0);
           var viewerModel = (ReportViewerModel)layoutRoot.DataContext;
           var printCommand = viewerModel.PrintReportCommand;
           if (printCommand.CanExecute(null))
           {
               printCommand.Execute(null);
           }
       }
   }

and in an event from your external UI invoke the method:

private void button1_Click(object sender, RoutedEventArgs e)
       {
           this.ReportViewer1.PrintReport();
       }


Greetings,
Steve
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Uwe Bach
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or