cancel
Showing results for 
Search instead for 
Did you mean: 

CRVS2010 - WPF binding the ReportDocument to a view model variable

Former Member
0 Kudos

hi.

I can see how to set the ReportDocument in the viewer using the code behind.

Is it possible to set it using data binding - so I can have a property "CurrentReportDocument" in my view model and have it bound to the report the WPF viewer is displaying?

thanks

Peter

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi.

I can't see how to bind the .ReportSource property in the XAML - it doesn't show up in intellisense.

Peter

Former Member
0 Kudos

I was referring to binding the report to the viewer in the codebehind and not in XAML. Here's an example of what I was referring to....


        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            //Using the ReportDocument SDK
            this._report = new ReportDocument();
            this._report.Load(<path_to_report_file>);
            this.reportViewer.ViewerCore.ReportSource = this._report;
        }

Former Member
0 Kudos

I'd love to know this too. Our entire application follows the M-V-VM pattern and I can't figure out.

Answers (1)

Answers (1)

Former Member
0 Kudos

Bump!

Does anyone know how to bind to the report property? Perhaps it would help if I could read the help files - but they don't seem to be included in the beta 2 download and the link I found somewhere to the help files isn't valid anymore.

peter

Former Member
0 Kudos

The only way to bind a report to the WPF viewer is to set it's .ReportSource property to an instance of a ReportDocument object. It sounds like you've already figure this part out, but not sure how you want to bind the report to the viewer.