I am using JasperReports in a framework to create pdf reports. But I am
running into a bit of trouble. I have some reports that use an SQL
connection and some reports that use custom datasources. I would like to
use one uniform API in both situations.
With a small change in the JRDataSource and in JRFiller I can have one API
By creating a method
public void init(JRReport report)
in the JRDataSource API
and calling that method in the beginning of JRFiller's
public static JasperPrint fillReport(
) throws JRException
I can create a JRResultSetDatasource that does it's own query. And I can
change it with any other datasource I like (for instance for testing
Is it possible to change the API in such a way or maybe create an
abstract class/extra interface to make this possible?