I am resusing the Report Viewer Control depending on a selection the user
makes.
I load the report definition as follows:
rvFBReport.LocalReport.LoadReportDefinition(sr)
where sr is a streamreader loading the rdl file.
Then I pass in the datasource via:
rvFBReport.LocalReport.DataSources.Add(rds)
where rds is a reportdatasource.
It works great until I try loading a different report using the same
reportviewer.
I have also tried using rvFleetInvoices.LocalReport.DataSources.Clear()
but to no effect. What happens is the report comes up but contains no data
even though there is. It is almost as if the report is not refreshing the
data when switching between different RDL's
Any help/thoughts would be appreciated.Here is another symptom that may narrow it down. If the other reports that I
select has fields with the same name then those fields show up. But any
fields that were not in the first loaded report do not show up. It is almost
as if the datasource is not refreshing the field list.
"Scott Eguires" wrote:
> I am resusing the Report Viewer Control depending on a selection the user
> makes.
> I load the report definition as follows:
> rvFBReport.LocalReport.LoadReportDefinition(sr)
> where sr is a streamreader loading the rdl file.
> Then I pass in the datasource via:
> rvFBReport.LocalReport.DataSources.Add(rds)
> where rds is a reportdatasource.
> It works great until I try loading a different report using the same
> reportviewer.
> I have also tried using rvFleetInvoices.LocalReport.DataSources.Clear()
> but to no effect. What happens is the report comes up but contains no data
> even though there is. It is almost as if the report is not refreshing the
> data when switching between different RDL's
> Any help/thoughts would be appreciated.|||Never Mind I solved it myself. You have to do a reset before making the
change. i.e.,
reportviewer1.reset
"Scott Eguires" wrote:
> I am resusing the Report Viewer Control depending on a selection the user
> makes.
> I load the report definition as follows:
> rvFBReport.LocalReport.LoadReportDefinition(sr)
> where sr is a streamreader loading the rdl file.
> Then I pass in the datasource via:
> rvFBReport.LocalReport.DataSources.Add(rds)
> where rds is a reportdatasource.
> It works great until I try loading a different report using the same
> reportviewer.
> I have also tried using rvFleetInvoices.LocalReport.DataSources.Clear()
> but to no effect. What happens is the report comes up but contains no data
> even though there is. It is almost as if the report is not refreshing the
> data when switching between different RDL's
> Any help/thoughts would be appreciated.