Formula in kreporter


I have json string, and i tried use json_decode function in formula in kreporter, and seem it didn’t worked
Is kreporter support json function in formula or not?


It won’t. A json_decode will return an object or an array. You need a string to display anyway, don’t you?
Create a function in custom/include/custom_utils.php in which you make a readable string of your json data.
Then call the function in formula and pass the field (stored variable in manipulate) to your function.
That shall do the trick.

Thanks maretval
It worked for me
About reason we can’t use json_decode($jsonString) because on kreporter it use htmlentities for convert jsonString to html code, we can use directly as json_decode(html_entity_decode($jsonString))
But your suggest better for handler exception