darth_fader Posted November 8, 2010 Share Posted November 8, 2010 I've developed a simple web app integration solution that will remove the headaches associated with deployment and integration of jasper reports into a web application. You will not have to write a single line of java code. Guaranteed. To integrate this solution, all you have to do is perform the following three step process:1) register report.spring.xml (spring configuration file) and a custom jasperReports servlet in web.xml2) create a "reports" folder in your META-INF directory, and put all of your reports and report resources in that directory (can be jrxml, .jasper, folders, images, etc.)3) format links in your views that point to the custom jasperReports servlet and contain the required request parameters.ex: /yourAppRoot/jasper.report?uniqueId=1&reportName=general_case_info&reportType=application/pdf where the request parameters are as follows: uniqueId: the jasper report parameter used in your sql query to pull data for a given unique identifier reportName: the name of the .jrxml file or .jasper file you are referencing reportType: the type of report you would like to generateIn the above example, uniqueId is 1, reportName is general_case_info, and reportType is pdf. You can optionally also specify the name of the file name that jasper generates, so you have a quality unique file name that can easily be downloaded/saved. And that's it. Simple as that. Other benefits include: a resource locator, eliminates the need to specify paths to images, subReports, etc in a .jrxml file (all you do is specify the resource name, and if it exists, it will be found) on the fly report compilation: no need to pre-compile the reports, if you reference a .jrxml file, it will be compiled on request separation of duties: allows developers to focus on development, allows report designers to focus on design, neither role need be bothered with jasper reports integrationIf you're interested in this solution, email me at psycodekIT@gmail.com or visit psycodek.com and click the "Contact Us" link. I'll provide you with additional details and a link to a demo application. Link to comment Share on other sites More sharing options...
darth_fader Posted November 8, 2010 Author Share Posted November 8, 2010 FYI: This solution, packaged as a very light weight jar, is compatible with Spring 2.x+ and Jasper 2.x+. As far as spring beans go, there are a grand total of 5 singleton spring beans (working on reducing that number), so the footprint is small. I'm also working on a pure JEE solution, for those that don't currently have or want to introduce Spring dependencies. Link to comment Share on other sites More sharing options...
darth_fader Posted November 16, 2010 Author Share Posted November 16, 2010 I'd like to clarify, that if you have a typical Spring/Hibernate/JSF setup, this module is a zero java code solution. Simple spring.xml config. The pure JEE6 solution, eliminating Spring, is well underway. 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