Home
Analytics
Use a javascript file
cmrdjr
I have a report that has several datasets that all have the same scripting to deal with parameters. I found where I could create a javascript file and then include the javascript file in the XML of the report so that I could have all my javascript in one place.
I have been able to get this to work in my development environment (my PC) and can see the results in the Preview window as well as the Report Viewer.
The issue starts with I try to access the report on my institutions server. I have put the javascript file in the resources directoy, the same directory as the report design, and the scriptlib directory. I get a nullPointerException when the reportDesign tries to find the javascript file.
Is there an option on the Report View to allow/disallow the report designs to use other files on the server?
Any thoughts as to why the report design would not be able to see or access the javascript file?
Any help would be appreciated as my server admins are at a loss.
Thanks,
Find more posts tagged with
Comments
mwilliams
Hi cmrdjr,
And you have added this .js file as a resource to the report in the property editor, correct?
Virgil Dodson
If you navigated to your .JS file from the Property Editor (Select a blank part of the report -> Properties -> Resources -> JavaScript Files -> Add...) then check the XML source of your report design to see what it is looking for. I had a similar problem when I had my JS file in a folder of my report project, but not on my server.
cmrdjr
Michael,
For some reason I did not get an email when you replied.
Yes the file is listed as a resource on the Resources tab under the Javascript Files section.
Here is the XML. both the .rptlibrary and the .js are in my resources directory which is the same directory for the .rptlibary on our server.
<list-property name="libraries">
<structure>
<property name="fileName">ie_gl_aux_library.rptlibrary</property>
<property name="namespace">ie_gl_aux_library</property>
</structure>
</list-property>
<list-property name="includeScripts">
<property>ie_gl_aux_javascript.js</property>
</list-property>