Click here to Skip to main content
15,888,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#



_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
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900