I have a windows form with the ReportViewer control on it which I re-use to show various reports. I also have properties on that form to set the report parameters. The first time I show a report with the form it works fine. But for some reason after that I get conversion errors with what seems to be the passing of the report parameters. It's as if it's not closing down the form fully or something.
The start of my form code is like this (I pass in the report I want to view):
public partial class ReportTester : Form
{
public ReportTester(Telerik.Reporting.Report Report)
{
InitializeComponent();
reportViewer1.Report = Report;
reportViewer1.RefreshReport();
}
public int UserId
{
set { reportViewer1.Report.ReportParameters["UserID"].Value = value; }
}
...
And then in my main form I launch reports like this:
ReportTester report;
if (type == ReportTypeEnum.Regular)
{
report = new ReportTester(new BPReports.Report1());
}
else
{
report = new ReportTester(new BPReports.Report2());
}
report.UserId = _currUser;
report.ShowDialog();
....
But the second time I show a report even if it's the same report I get an error in the viewer about not being able to convert int to string or string to datetime.
Any ideas?
The start of my form code is like this (I pass in the report I want to view):
public partial class ReportTester : Form
{
public ReportTester(Telerik.Reporting.Report Report)
{
InitializeComponent();
reportViewer1.Report = Report;
reportViewer1.RefreshReport();
}
public int UserId
{
set { reportViewer1.Report.ReportParameters["UserID"].Value = value; }
}
...
And then in my main form I launch reports like this:
ReportTester report;
if (type == ReportTypeEnum.Regular)
{
report = new ReportTester(new BPReports.Report1());
}
else
{
report = new ReportTester(new BPReports.Report2());
}
report.UserId = _currUser;
report.ShowDialog();
....
But the second time I show a report even if it's the same report I get an error in the viewer about not being able to convert int to string or string to datetime.
Any ideas?