As you can see on image below DateTime parameter type is supported in RDLC.
I'm trying to set parameter like this but this code doesn't compile with error that there is not constructor accepting this type of arguments:
var p = new Microsoft.Reporting.WinForms.ReportParameter("ReportParameter1", DateTime.Now);
LocalReport.SetParameters(p);
Is there a way to set DateTime or even DateTime? (nullable) as parameter so it can be used for further report calculations without converting it to string ?
None of the constuctors for ReportParameter take a DateTime. See here.
You can probably make it work with:
var p = new Microsoft.Reporting.WinForms.ReportParameter("ReportParameter1", DateTime.Now.ToString("MM/dd/yyyy"));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With