waqar Posted December 17, 2009 Share Posted December 17, 2009 Hi,I am new to jasper.Looking for some basic understanding about how to deploy my report on server (ubuntu and jboss).1 - Do i need to install jasperreports on my server as well.2 - How to maintain the DB connection of all the reports. Do i have to change them and recompile the reports according to server path.3 - Do i have to change the images path to some http:// on each imagethanks Link to comment Share on other sites More sharing options...
jmurray Posted December 18, 2009 Share Posted December 18, 2009 1) Yes you do, and it should be the same version as the copy of JasperReports that you use on your development box if you want to avoid compatibility issues. You'll need to include any addons (eg. mysql or ojdbc drivers, etc.) in the server's classpath too.2) If you will be pointing your deployed reports at a different database you should make that change on the server engine, not the reports. This could be a hardcoded connection string in ReportEngine.java (yuk!), or if you're using something like Torque under Apache then you would define your database connections in the WEB-INF/conf/Torque.properties file of your JasperReports project so that they can be read by ReportEngine.java.3) Paths for images and subreport jasper files are almost always different and will definitely need to be changed when you deploy each report. The paths for images don't need to point to a web resource as http://, they just need to reference the correct location for the source file(s) on the server.For example: on your development PC an image might be referenced as "c:/myreports/images/myimage.png", but when you deploy it you might need to specify "/usr/share/tomcat5/webapps/ROOT/reports/src/images/myinage.png". The exact path to your images and subreport files will depend on how your JasperReport engine is deployed and the structure of your reports diectory.I hope I have provided enough clues for you to follow up on. It's not really possible to provide specific answers or examples because server implementations can vary remarkably. Link to comment Share on other sites More sharing options...
waqar Posted December 18, 2009 Author Share Posted December 18, 2009 Thanks Murray for providing so much info. I will try these options on my server.+10 Link to comment Share on other sites More sharing options...
jmurray Posted December 20, 2009 Share Posted December 20, 2009 One more thing:if you are using relative paths to point to your images (eg. ../images/myimage.png) you may not get the result you were after when you deploy the reports to the server.The root path on the server will be the directory where the application is running (eg. for tomcat /usr/share/tomcat5/) NOT the reports directory. I found it easier to reference the full path to image and subreport repositories in variables and use those whenever you need to point to an image or subreport.Sorry to go on about tomcat all the time, but it's all I know /tools/fckeditor/editor/images/smiley/msn/regular_smile.gif Link to comment Share on other sites More sharing options...
acarmar Posted April 26, 2012 Share Posted April 26, 2012 Hi, there are a tool for deploy the reports and arranges the problem with he image paths. The tool is on http://sourceforge.net/projects/jaspertools/?source=directoryBye. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now