Some questions about Jasper in general

0

hello everyone I'm supposed to answer some basic questions regarding Jasper for my company. And would be grateful if someone could help me :) . 

I am quite new in project management and am a bit overwhelmed with this task. (i am extremely grateful for any help i receive!)

1.)    How can I create reports in JasperReports? (very likely similar to Activity Reports?) 
2.)    How can the data be transferred to JasperReports? (e.g. connection of external systems, file base etc.). The data must be transferred from other programs (Excel, Lobster, csv, txt) to Jasper, so that the created templates can be used. 
3.)    How can the reports be printed and transferred as a file?

 

many thanks in advance :D 

rxe12953's picture
Joined: Sep 20 2019 - 2:08am
Last seen: 1 month 3 weeks ago

1 Answer:

0

Well the report designs (jrxmls) are written within a Designer like JasperSoft Studio or the older version iReport (but there just the old versions of JaspertReports < 6.x are supported - so take the Studio for the latest JasperReports release).

You will have to load that design in your java app (I assume you have one or you want to create an app) by Jasper API e.g. from FileSystem by JRLoader and will get a JasperReport-Object. (compile the .jrxml by the JRCompileManager or just load the generated .jasper files generates by the designer as well)

The data for that JasperReport-Object are passed in different ways depending of your architecture.... so if you have just a simple CSV file you could create JRCSVDataSource and load the records for passing them to the JRFillManager that transforms the data to the wanted report result. (normally the data are stored within a database and you will fetch them by sql query - but therefore JasperReports is very flexible and you can use simple files like csv/xml/json/xls/... also as "datasource")

After you have called the filling process you will get an JRPrint-Object that could be send to a printer by using the JRPrintServiceExporter or you could export it to a PDF File with the JRPDFExporter.

If you start from a green field - as it sounds - I would advice loading the FULL JASPERREPORTS Project from Sourceforge and take a look into the samples. There you can learn a lot of your requirements (loading data from file, transform it to a report and export/print it).

The alternative to the Jasper API would be to install the JasperReport-Server that is a kind of ReportServer, where you can manage all that stuff for loading designs and filling them with different datasources (so normally by sql-connection or also by xml/csv/excel files) and save the output as pdf or just view it in brower or send it to a printer. So it depends on your architecture/infrastructure/needs?!?! :-)

hth + regards

C-Box

C-Box's picture
2122
Joined: Jul 19 2006 - 5:58pm
Last seen: 19 hours 48 min ago
Feedback