Jacqui1811
Programmer
Hi,
I have a main report and a sub-report which gets its data from a different table.
When I run the main report it does not show the sub report.
The sub report runs on it's own as a main report and shows me the data I expect to see.
There are no parameters or anything complex.
I have added a sub report below the main report on the report designer for the main report and assigned the sub report I wish to show to it.
Can anybody help a little please
Regards
Jacqui.
I am using the below code in the form that has the report viewer control
private void Form1_Load(object sender, EventArgs e)
{ System.Data.SqlClient.SqlConnection(_connectionString);
this.AddressTableAdapter.Fill(this.AdventureWorksDataSet.Address);
reportViewer1.LocalReport.SubreportProcessing += new Microsoft.Reporting.WinForms.SubreportProcessingEventHandler(LocalReport_SubreportProcessing);
this.reportViewer1.RefreshReport();
}
void LocalReport_SubreportProcessing(object sender, Microsoft.Reporting.WinForms.SubreportProcessingEventArgs e)
{
ReportDataSource reportDataSource1 = new ReportDataSource();
reportDataSource1.Name = "AdventureWorksDataSet1_AddressType";
reportDataSource1.Value = this.AddressTypeBindingSource;
e.DataSources.Add(reportDataSource1);
}
I have a main report and a sub-report which gets its data from a different table.
When I run the main report it does not show the sub report.
The sub report runs on it's own as a main report and shows me the data I expect to see.
There are no parameters or anything complex.
I have added a sub report below the main report on the report designer for the main report and assigned the sub report I wish to show to it.
Can anybody help a little please
Regards
Jacqui.
I am using the below code in the form that has the report viewer control
private void Form1_Load(object sender, EventArgs e)
{ System.Data.SqlClient.SqlConnection(_connectionString);
this.AddressTableAdapter.Fill(this.AdventureWorksDataSet.Address);
reportViewer1.LocalReport.SubreportProcessing += new Microsoft.Reporting.WinForms.SubreportProcessingEventHandler(LocalReport_SubreportProcessing);
this.reportViewer1.RefreshReport();
}
void LocalReport_SubreportProcessing(object sender, Microsoft.Reporting.WinForms.SubreportProcessingEventArgs e)
{
ReportDataSource reportDataSource1 = new ReportDataSource();
reportDataSource1.Name = "AdventureWorksDataSet1_AddressType";
reportDataSource1.Value = this.AddressTypeBindingSource;
e.DataSources.Add(reportDataSource1);
}