_reportViewer.Load += ReportViewer_Load;
}
private void window_Loaded(object sender, RoutedEventArgs e)
{
}
private bool _isReportViewerLoaded;
private void ReportViewer_Load(object sender, EventArgs e)
{
DataSet ds = new DataSet();
ds.ReadXml("Data.xml");
ds.WriteXmlSchema("Data.xsd");
if (!_isReportViewerLoaded)
{
Microsoft.Reporting.WinForms.ReportDataSource reportDataSource1 = new
Microsoft.Reporting.WinForms.ReportDataSource();
reportDataSource1.Name = "DataSet1";
//Name of the report dataset in our .RDLC file
reportDataSource1.Value = ds.Tables;
ReportDataSource rds = new ReportDataSource("Name", ds.Tables[1]);
this._reportViewer.LocalReport.DataSources.Add(reportDataSource1);
this._reportViewer.LocalReport.ReportPath = "../../Report1.rdlc";
this.
//accountsTableAdapter.ClearBeforeFill = true;
//accountsTableAdapter.Fill(dataset.);
_reportViewer.RefreshReport();
_isReportViewerLoaded = true;
}
}
What I have tried:
I have tried using breakpoint to check the values are coming in ds.table but all the example in google are all windows or in sql connection but iam only reading a xml file. I have checked to add Dataadapter but that is only for sql database it is not allowing me throught rdlc AND I have added windowformhost in wpf and added the reportviwer windows windos