This is a migrated thread and some comments may be shown as answers.

IsNull Function is not Working in Standalone telerik Report

4 Answers 112 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Bharat
Top achievements
Rank 1
Bharat asked on 02 Jul 2019, 06:59 AM

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.

4 Answers, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 04 Jul 2019, 03:10 PM
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
0
Matthias
Top achievements
Rank 1
answered on 15 Jul 2019, 03:21 PM

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

0
Neli
Telerik team
answered on 18 Jul 2019, 08:24 AM
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
0
Tyler
Top achievements
Rank 1
answered on 17 Jan 2021, 09:53 PM

I was able to workaround this issue by converting the offending field to a string (= CStr(Fields.YourField)) And then using a Sum/Iif statement to make the column invisible if there were no values in it.

= Sum(IIf(IsNull(CStr(Fields.YourField),0)="",0,1))  =  =0

Hopefully this helps someone else and saves them some time.

Tags
Report Designer (standalone)
Asked by
Bharat
Top achievements
Rank 1
Answers by
Neli
Telerik team
Matthias
Top achievements
Rank 1
Tyler
Top achievements
Rank 1
Share this question
or