ReportViewer datadinding (WPF)

Posted by user512150 on Stack Overflow See other posts from Stack Overflow or by user512150
Published on 2011-01-04T10:33:46Z Indexed on 2011/01/04 10:54 UTC
Read the original article Hit count: 217

Filed under:
|
|

I have a rdlc file and I try to show it using report viewer control in WPF. My DataSource is called 'OfficeDataSet' and DataSet used in report is called 'Address'. I try to initialize report viewer (I put it in WindowsFormsHost) like this:

 private void PrepareReport()
    {
        reportDataSource = new ReportDataSource();
        officeDataSet = new OfficeDataSet();            
        adapter = new AddressTableAdapter();
        adapter.Fill(officeDataSet.Address);

        reportDataSource.Name = "OfficeDataSet_Address";
        reportDataSource.Value = officeDataSet.Address;
        viewerInstance.LocalReport.DataSources.Add(reportDataSource);
        viewerInstance.LocalReport.ReportEmbeddedResource = "WpfApplication1.Reports.TestReport.rdlc";
        viewerInstance.Location = new System.Drawing.Point(0, 0);

        viewerInstance.RefreshReport();
    }   

but I got the message "A data source instance has not been supplied for the data source 'Address'". Anybody know what can be wrong with this code? (I'm totally new in WPF and Reporting Services).

© Stack Overflow or respective owner

Related posts about wpf

Related posts about reporting-services