2

I'm embedding a simple server report in UI using Jaspersoft's javascript API visualize.js script. For the web view I'm facing no issues. I have attached the image showing successful display.

Web-View

Now for the same code, on running as cordova hybrid app seeing this error being thrown from visualize.js code:-

TypeError: null is not an object (evaluating 't')

I have attached the exception stacktrace image.

stacktrace for cordova app

As mentioned on Jaspersoft website I'm injecting the visualize.js library into my webpage using a script tag and an empty div tag with id "container". After which I have added the authentication code and the 'v' object which is my logged in instance within jaspersoft report server. These steps are as per the usage guide on jaspersoft community website. Also, there is no issue in the web view and the graph gets displayed as expected which confirms the fact that there is no problem with the code.

Does visualize.js even support rendering visualization reports on client for cordova hybrid apps? If yes, any idea why this error.

Hina Dawood
  • 3,201
  • 2
  • 10
  • 8

1 Answers1

0

Not sure this was your error, but I got the same one.

In my case the error occurred because the loaded view contains a date filter with the value "null". This is serialized as a JSON object (NULL) without a value property, thus the value will be undefined. The code inside visualize.js does not handle that case correctly.

In my case I changed the ad hoc view. Instead of filtering <> NULL I instead filter on > 1900-01-01. This way null values are filtered out, and as long as no values are less than that date the result will be the same. With this change the view could be loaded.

You could try to check the filter values of your view.

Gerold
  • 1
  • 1