I have an application that has an angular 6 client with telerik reporting viewer,and C# api server.
I have created a report with the report designer. the report has 2 dateTime parameters defined like in the snapshot:
Now, I use it in the web service data source like on the other snapshot
So far so good.
I update the parameters value from my clients this way:
let rs =
{
report: this.reportName,
authenticationToken: token,
parametersAreaVisible: true,
parameters: {
networkItemsKeys: JSON.stringify(parameters.tags),
token: token, userName:this.userName,
toDate: parameters.toDate,
fromDate: parameters.fromDate } }
as unknown as JSON;
this.reportSource = rs; this.reportViewer.setReportSource(rs);
parameters.toDate is DateTime property.
I can see that the date parameters are updated fine when looking at a textbox defined this way:
Report Period: {Parameters.fromDate.Value.toShortDateString()}-{Parameters.toDate.Value.toShortDateString()}
The problem is that when I check the value that is received in my web api has month and days switched so if the day is greater than 12 the parameter value is 1/1/0001. I have tried all sorts of datepipe format changes, with no success.
The problem is solved when I use the toDate and fromDate as string parameters, but is seems like a stupid solution, and that way I can't use the date type abilities like .toShortDateString() in the text box. Any ideas?
TX Tal