Jump to content

deployment related basic questions.


waqar

Recommended Posts

 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 image

thanks

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

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

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

  • 2 years later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...