salemme Posted August 13, 2008 Share Posted August 13, 2008 Hello-I am fairly new to JasperReports so bare with me. In the past, I have used iReport to create reports which I then run through iReports and can export as PDF, CSV, etc. My question is, how can I take a .jrxml file that I have created in iReport, and run it as say a PDF file? This is easily done thru iReports but I would like to eventually automate this using a scripting utility. Thanks! -Nate Link to comment Share on other sites More sharing options...
amodg Posted August 14, 2008 Share Posted August 14, 2008 Hello,Could you please elaborate more on what exactly you are trying to achieve?As you have worked on exporting reports to PDF,you must have used the methods like runReportToPdf() etc. Link to comment Share on other sites More sharing options...
salemme Posted August 14, 2008 Author Share Posted August 14, 2008 Amod- Thanks for the reply. When I say I have worked with exporting reports, I mean just using iReports. I have not created a java application that will export a report. Basically I'd like to use iReports to create the report .jrxml file. I would then like to setup a VERY basic java script or application that takes the already created .jrxml file, runs it , and exports a pdf version. The idea here is that I would eventually use some type of scheduling application like cronjob to automate this process. I know a little java, but not much. I guess the piece that I am missing is the java application that uses the jasper reports open source to simply compile, and export a report. Do you have any code you would be willing to share? The java application would run natively on linux, and would need to be something I could just call from the command line. I really appreciate the help. If it would be easier, we could speak over email or phone. I think 5 minutes of your time would be all I need. Thanks much!Natensalemme 'at' gmail.com Link to comment Share on other sites More sharing options...
amodg Posted August 19, 2008 Share Posted August 19, 2008 Hi Nate,I use jasper report in my application.Here after creating a jrxml file,we use a class(we need java here) which compiles this file and converts it into a file called .jasper.During compilation,it is checked for all the required aspects like the validity of xml,report design etc.Once the compilation is successful,we can use this jasper file to generate the report.Now,to run this report we use a method(we also need java :) here) where we pass the reference to this jasper file.So, though I give you a java code to compile a report,the question remains as how you are going to run the report just by using javascript. You may need ask someone.Being a java guy,if you need reports using java, surely I can help you out with the code or we can discuss it over email.thanks Link to comment Share on other sites More sharing options...
svenn Posted August 19, 2008 Share Posted August 19, 2008 To add to this. If you do not need to dynamically create your reports at run time you should be executing the .jasper files and not compliing the .jrxml files then running them. Link to comment Share on other sites More sharing options...
amodg Posted August 20, 2008 Share Posted August 20, 2008 Scott,what you are saying is perfectly all right.But is it possible to run the report just by using a compiled .jasper file and a javascript function?Don't we need anything that understands(like JVM) .jasper file and renders the report accordingly. Thanks. 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