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

Launch compled Jasper reports from a JAVA GUI


jkeri

Recommended Posts

I have a client who wants to run compiled jasper report, not from a Jasper reports server, but instead from a Java GUI application that they can write in-house.  Does anyone know a website or other resourse where I can further explore this option?

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Using the jasper api, a java class can be written with a datasource.

Below imports would help.

import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.view.JasperViewer;

import java.sql.Connection;
import java.sql.DriverManager;

 

Check this page.

http://www.programcreek.com/java-api-examples/index.php?api=net.sf.jasperreports.engine.JasperFillManager

In order to access this class, you might have to write the code for a html page.

Link to comment
Share on other sites

  • 2 weeks later...

Hi you can also try jasperstarter

you can launch a jaspereport () from command line to view print or export  

the data source defined in a conf file and you can also pass parameters to your report 

https://sourceforge.net/projects/jasperstarter/

For example My report is launched by command line

"F:Program Files (x86)JasperStarterbinjasperstarter.exe" pr "F:Program Files (x86)JasperStarterbindocsage.jasper" -f view @"F:Program Files (x86)JasperStarterbinsagebijou.conf" -P dopiece=%1 -a

For example my sagebijou.conf file content

-t

generic

--db-driver
net.sourceforge.jtds.jdbc.Driver
--db-url
jdbc:jtds:sqlserver://localhost:1435/BIJOU
-u
Username
-p
Password
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...