J
Johnyyy
Guest
I got two parameters for my report:
ActionOwnerDate_from
DateType: Date/Time with default value defined as expression:
=DateAdd("yyyy", -50, Now)
ActionOwnerDate_to
DateType: Date/Time with default value defined as expression:
=Now
I got error on this line:
reportViewer1.ServerReport.SetParameters(rptParameters);
Error:
Microsoft.Reporting.WinForms.ReportServerException: 'The value provided for the report parameter 'ActionOwnerDate_from' is not valid for its type. (rsReportParameterTypeMismatch)'
Full code:
reportViewer1.ServerReport.ReportServerUrl = new Uri("http://desktop-85h15ki/ReportServer_MSSQLSERVERREPOR");
reportViewer1.ServerReport.ReportPath = "/Report Project2/Raport1";
reportViewer1.ProcessingMode = ProcessingMode.Remote;
var rptParameters = new List<ReportParameter>
{
new ReportParameter("ActionOwnerDate_from",
DateTime.Now.AddYears(-10).ToString(CultureInfo.InvariantCulture)),
new ReportParameter("ActionOwnerDate_to", DateTime.Now.ToString(CultureInfo.InvariantCulture))
};
reportViewer1.ServerReport.SetParameters(rptParameters);
reportViewer1.ServerReport.Refresh();
reportViewer1.RefreshReport();
Continue reading...
ActionOwnerDate_from
DateType: Date/Time with default value defined as expression:
=DateAdd("yyyy", -50, Now)
ActionOwnerDate_to
DateType: Date/Time with default value defined as expression:
=Now
I got error on this line:
reportViewer1.ServerReport.SetParameters(rptParameters);
Error:
Microsoft.Reporting.WinForms.ReportServerException: 'The value provided for the report parameter 'ActionOwnerDate_from' is not valid for its type. (rsReportParameterTypeMismatch)'
Full code:
reportViewer1.ServerReport.ReportServerUrl = new Uri("http://desktop-85h15ki/ReportServer_MSSQLSERVERREPOR");
reportViewer1.ServerReport.ReportPath = "/Report Project2/Raport1";
reportViewer1.ProcessingMode = ProcessingMode.Remote;
var rptParameters = new List<ReportParameter>
{
new ReportParameter("ActionOwnerDate_from",
DateTime.Now.AddYears(-10).ToString(CultureInfo.InvariantCulture)),
new ReportParameter("ActionOwnerDate_to", DateTime.Now.ToString(CultureInfo.InvariantCulture))
};
reportViewer1.ServerReport.SetParameters(rptParameters);
reportViewer1.ServerReport.Refresh();
reportViewer1.RefreshReport();
Continue reading...