Page 1 of 1

Datetime type is not detected in JSON data

Posted: Wed Mar 14, 2018 10:03 am
by lega
Reproduction
Create new report
Bind the report to a JSON based dataset having a Date property
Open designer
Add a text element with binding expression that contains Year function passing our Date property.

Current Behavior
In Dictionary view this property datatype will be String
Opening Preview tabs gives "Expression in Text property of 'Text1' can't be evaluated! Parser error: There is no matching overloaded method for 'Year(String)'" warning
Print to PDF fails with "Cannot read property 'replace' of undefined" in console

Expected behavior
DateTime type is detected from JSON data and DateTime functions don't fail report rendering.

The repro in attachment.

To start, run

Code: Select all

node server.js
and navigate to http://127.0.0.1:8081/
Or use your own http server.

Thanks

Re: Datetime type is not detected in JSON data

Posted: Fri Mar 16, 2018 8:16 am
by Alex K.
Hello,

Your column is string and in Year function you should send DateTime. Please try to use the following expression:
{Year(DateTime.Parse(YourColumn))}

Thank you.