Jump to content
We've recently updated our Privacy Statement, available here ×

How to call Jasper Report in java (Jaspersoft Studio 6.3.1 )


zedenehoxi

Recommended Posts

I have successfully installed and created report using Jaspersoft Studio 6.3.1 (not iReport Designer) on windows 10.
Since Jaspersoft Studio generate only one .jrxml file(not like iReport) i can't think where to put it and how to call it through java class.

Could anyone explain how to call it from java class?, that would be great help for me and other newbies.

Yes, of course i went through several example that can be found with google search. but all of them are outdated.

Link to comment
Share on other sites

  • 1 year later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi,

   You have to compile that jrxml file into a .jasper one. For that press the compile button that is above in the screen and the compiled target file will be saved in your workspace. :)

Then from java you have to charge the parameters (declared in the report) in a object[][] and then call  it with:

            JasperPrint print = JasperFillManager.fillReport(filePath/filename, parameters,new JREmptyDataSource());
                byteArray=JasperExportManager.exportReportToPdf(print);

 

 

Link to comment
Share on other sites

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...