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

MVVM Report binding

1 Answer 181 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rodro
Top achievements
Rank 2
Rodro asked on 23 May 2010, 08:24 AM
I'm trying to put report in report viewer from MMV pattern but doesn't work.

in xaml

    <Wpf:ReportViewer Name="ReportViewer1"  Report="{Binding Reporting}"  Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Grid.RowSpan="2" Background="Transparent"></Wpf:ReportViewer>

and in view model:

 AttendanceSheetReport Reporting
        {
            get { return _reporting; }
            set
            {
                if(value!= _reporting)
                {
                    _reporting = value;
                    InvokePropertyChanged("Reporting");
                }
            }
        }

If I create report from code behind like that:

AttendanceSheetReport rep = new AttendanceSheetReport();
....
this.ReportViewer1.Report = rep;

I've no problema, but if I try to bind the response is No Report. can You help me?






1 Answer, 1 is accepted

Sort by
0
Rodro
Top achievements
Rank 2
answered on 24 May 2010, 05:43 AM
I resolved the issue, report viewer refer to report viewer model and not to view model that hosts the control
Tags
General Discussions
Asked by
Rodro
Top achievements
Rank 2
Answers by
Rodro
Top achievements
Rank 2
Share this question
or