Template value not displaying using ejs
-
Hi,
Been struggling with a small issue. I'm using ejs with chrome-pdf to put a report together. Everything works in the cloud jsreport studio, but when I call the template from a remote backend it doesn't.
I have narrowed the issue down, and can illustrate the code with:
'''
<%= Cables.Voltage.U.m_magnitude || "" %>
''''Cables' is a JSON object.
In jsreports studio, the value of voltage is correctly rendered. On a remote template call, it is blank.
I think it has something to going too deep. For example 'Cables.Voltage.Phase' or 'Cables.Voltage.isAC' works both studio and remote. 'Cables.Voltage.U' returns an object, both studio and remote. It is only when I add the '.m_magnitude' that it works only on studio.
The following screen clips show the value on studio, but no value with a remote template render.
Steven
-
Fixed my issue. Just in case anyone ever runs into this, it was 'JsonConvert.SerializeObject'.
I was using JsonConver in my back end to send data to be rendered. Unfortunately, it was changing the property names. 'm_magnitude' was being changed to 'Magnitude'. When designing the report I use the data without serialisation, so there was a mismatch. Now I know the issue, I can work on the solution.