Where to put Jasper Reports?

Hello,

I have a situation where I have very limited access to the directory structure of the server. Servoy is hosted by a host company.

When I change my solution I can make a servoy solution file and import this within the application server. But how about my reports? These reports are not in the Servoy file.

I already asked to provide a possibility in the Application Server to make it possible to upload reports like we can upload beans and plugins.

But I would also like to have a possibility to deploy my reports with my solution. So the best way would probably a possibility that the reports are in the Servoy solution file. Is that possible?

And maybe you have some other solution for that. Please let me know.

Another problem is that my reports are prefixed with a prefix that determines the solution. It would be great if in case of deployment only the reports are in the solutionfile that belongs to that solution (and the included modules). Any suggestions to this situation are welcome as well.

An option would be to add your reports to the media library. You can retrieve them from there using the http.plugin:

plugins.http.getMediaData("media:///<report_name>")

I didn’t know this could be done. Just for clarification you are referring to the un-compiled version of a jasper report (*.jrxml) correct Joas?

I originally said “plugins.http.getPageData” in my previous post, but I did mean “plugins.http.getMediaData”, I corrected this above.

You can put every file you want in your media library. At the clients side, you can get it out using the http-plugin, as I said before. After that, you can write it to disk using the file-plugin and treat it like any other file.

Does that answer your question, Jeff?

Yup, thanks.

What has the plugins.http.getMediaData to do with location of Jasper reports and the deployment of the reports. I don’t see the relation.

Within the Preferences you must enter the location where the reports are stored. So I don’t see what the http plugin has to do with that.

Please explain it.

Well, you don’t have to enter the location where the reports are stored, you can also leave that field in the preferences empty and use the entire path to the report-file in your plugin call.

So if you store your report in the media library (where usually only the images go), you can get it out using the http-plugin, write it to a place where you do have access (like the home directory) and run your report from there:

var _file = plugins.http.getMediaData("media:///<reportfile>");
var _path = plugins.file.getHomeDirectory() + "/<reportfile>";

plugins.file.writeFile(_path, _file);
plugins.jasperPluginRMI.jasperReport(controller.getServerName(), _path, null, 'viewer', null);

Does this make things clear?

Not really.

I still can’t install (new) reports on my webserver, where I don’t have full access to.

I prefer that Servoy creates an option like Plugins/Beans etc that reports can be uploaded as well.

At the moment I’m completely blocked.
I can’t install new/changes report without someone from the webserver datacenter.

And that is quite a problem.

You can just create your own Webclient solution to upload files to a global variable. From there, in a method, you can write the files to a directory on your server using the file plugin, since all the business logic is executed ServerSide.

Paul