IsNull Function is not Working in Standalone telerik Report

4 posts, 0 answers
  1. Bharat
    Bharat avatar
    10 posts
    Member since:
    Feb 2019

    Posted 02 Jul Link to this post

    Hello Telerik Team,

    I am using Telerik Standalone Designer.

    IsNull Function is not working for me.

    =IsNull(Fields.status, " ") 

    My Response is "status": null,

    It showing an error like this. "textbox cannot perform "=" Operation on Newtonsoft.Json.Linq.Jvalue and System.String"

    i have attached screenshot of the error for the more information to help you.
    Please Reply as soon as Possible.

    Thanks In Advance.

  2. Neli
    Admin
    Neli avatar
    190 posts

    Posted 04 Jul Link to this post

    Hi Bharat,

    From the error message, I suspect that status contains jvalue. Then IsNull compares different types of data and the exception is thrown. I will need more details about the scenario of the report and the context of IsNull. What kind of datasource do you use in the report and what is the data type of the status field?

    Regards,
    Neli
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Matthias
    Matthias avatar
    9 posts
    Member since:
    Jan 2016

    Posted 15 Jul Link to this post

    Hi Neli,

    I'm experiencing similar behavior. When I use a "Web Service Data Source" and check if a property of the result is null, it always returns false. I assume because the underlying object is an empty JValue. When I use the IsNull function I get the same error as Bharat has reported above.

    Based on the following JSON, when the "prop2" is null, I'd like to hide a panel that contains a text box displaying the "innerVal".

    {
      "prop1": "simpleValue",
      "prop2": {
        "innerVal": "simpleValue"
      }
    }

    I tried that by assigning a conditional formatting rule to the panel that hides the panel when

    Expression: = Fields.prop2
    Operator: =
    Value: Null

    But that didn't work.
    How would I display/hide some content of the report in case the value is not provided in the JSON result?

    Thanks
    Matthias

  4. Neli
    Admin
    Neli avatar
    190 posts

    Posted 18 Jul Link to this post

    Hello Matthias,

    We already know about this unexpected behavior which is cased by a bug. It is already logged in our Feedback portal - JsonDataSource evaluates NULL values incorrectly. Feel free to vote for it to increase its priority. 

    Regards,
    Neli
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top