Unplanned
Last Updated: 21 Jul 2023 13:10 by Joshua
Dominik
Created on: 14 Apr 2023 09:24
Type: Feature Request
3
Allow specifying the DateTimeKind for a DateTime ReportParameter

Currently the behavior of the Web Designer and Standalone Designer is different in regard to DateTime Report Parameters and its "Kind" property.
The Web Designer will assume the value is of Kind "Utc" and the Standalone Designer uses "Unspecified".

This recently became more of an issue since the newer PostgreSQL Provider versions are a lot more strict regarding the "Kind" property:
Npgsql: Timestamp rationalization and improvements

The consequence of this is not being able to use Sql parameters which will work in both the WebDesigner/WebViewer and the StandaloneDesigner:

To resolve this issue right now, one would need to resort to ugly workarounds:

  • Add a custom function which receives a DateTime "d" and DateTimeKind "k" value and returns the DateTime value "d" with the Kind set to "k"
    • Having to include a user dll to add that function seems overkill
    • You will need to change every report currently in use
  • Change the behavior of the WebDesigner to match the behavior of the Standalone Designer by using a custom IReportSourceResolver, manipulating currentParameterValues 
    • The Kind Property is set to "Unspecified" which is arguably the worst option to take between the three

 

To properly address this issue it needs to be possible to set the Kind property in the Viewer. Or at least the behavior between the WebDesigner and Standalone Designer should be the same.

Additionally/Alternativly it should be possible to set the target Kind in the Report Parameter.

With kind regards,
Dominik Rothert

2 comments
Joshua
Posted on: 21 Jul 2023 13:10

I just ran into this and we have arrived at roughly the same work around, which I hope means we have a sort of workable solution :)

The main difference was that I adjust my parameters in the CreateInstance of my ReportController, because I mainly need the HTML5 Viewer to work.

ADMIN
Dimitar
Posted on: 21 Apr 2023 08:59

Hello Dominik,

Thank you for the feedback!

We agree that there are scenarios where specifying the DateTime.Kind property might be necessary. However, adding such a property to the report parameter object itself is something that we, currently, do not want to do because that property would only be valid and make sense when the report parameter is of the DateTime Type.

Considering the above, we will instead expose a setting either in the report itself or in the designer application to control this behavior.

Regards,
Dimitar
Progress Telerik

Brand new Telerik Reporting course in Virtual Classroom - the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products. Check it out at https://learn.telerik.com/.