1
votes

i'm using Ireport 4.8.0 to create reports , i compile the report into jrxml and jasper files and display the report using these files on zuckerreport. so far i created many reports , even with string parameters and it all works fine.

when i asked to create a combobox (input control) parameter, i was told that this can be created only using Jasperreport server too. not only Ireport.

my question is: if i create a report in Ireport with an input control that is created using the jasperreport server and compile the report, are the report files (jrxml and jasper) independent ? what i mean is, if , in the future, i will try to run the report in zuckerreport without the jasperserver installed, will the report still work ? does the report files include all they need to work without the jasperreport server including the input contol parameter i created?

1

1 Answers

2
votes

It is kinda of hard to say they are independent. They are related I suppose. It is very similar to how java works. You have *.java and *.class files where class files are derived from the java files.

So the *.jrxml files is just a text document that contains the actual design of the report, in a more human friendly manner. In order to run the report, JasperReports needs the compiled version of the JRXML file. The *.jasper files is the compiled version that is then used to execute the report at runtime.

JasperServer is not a requirement. It depends on what you are trying to do. The reports technically have all the information they need to be compiled and executed. Like my comment on your previous question, it is essentially up to you to get the values for any parameters the report needs and pass them to the JasperReports when executing the report. JasperServer is just a means to this end, and provides a more user friendly GUI front end for doing this.

With out knowing how you intend your reports to be used/accessed by your end users it is difficult to give more direction. But in almost all scenarios you will need to create a screen that prompts the user for the required values of the parameters in the report and pass them to engine.

Now say you wanted to this all dynamically. It is possible in the simplest terms. If the parameters are essentially free form fields (user just type what ever they want), you could use the JasperReports API to get the parameters and their types. Then create the appropriate input field. This obviously falls apart when you want to limit the possible values of a parameter to some list. The information required to generate this list of values is not part of the JRXML or Jasper files.