Datasource configuration for a jasperreport in Jaspersoft studio

0

Suppose that I will use the code below to print a Jaserprreport from the Java side.

JasperPrint jasperPrint = JasperFillManager.fillReport(reporte, parametros, datasource);

How am I supposed to configure the datasource for the Jasperreport in Jaspersoft studio?

Thanks in advance.

P.S.: Although we can view the data source inforamation during the design phase, it seems that the data source has not been saved in the report xml file. In other words, I need to provide full database connection information on the Java application side.

Li Gang's picture
Joined: Sep 10 2019 - 4:18am
Last seen: 3 weeks 2 hours ago

s

iiyamasamurai - 1 month 1 day ago

1 Answer:

0

You will have to pass the connection or the (custom) datasource by your own if you run the report from withing your own application. The JasperStudio is just a designer tool with preview mode to design and test your report against a database/datasource. It's not made for "end-usage" by a customer or some "stupid/simple" report user. 

So just create a sql connection with ip/port/user/pw and pass this to the fillmanager in your calling app and pass it to the FillManager.

hth + regards

C-Box

C-Box's picture
1949
Joined: Jul 19 2006 - 5:58pm
Last seen: 9 hours 59 min ago
Feedback
randomness