I am using JfreeReport. I don't succeed to run a report with sub reoport inside. The report was designed by Report Designer 3.0.
The error is:
org.jfree.report.modules.misc.tablemodel.DataTableException: Accessing the result set failed:
.....
ParentException:
org.postgresql.util.PSQLException: This ResultSet is closed.
The code is:
DriverConnectionProvider provider = new DriverConnectionProvider();
provider.setDriver(Configuration.getPostgreSQLDriver());
provider.setProperty("user", Configuration.getPostgreSQLConnectionUsername());
provider.setProperty("password", Configuration.getPostgreSQLConnectionPassword());
provider.setUrl(Configuration.getPostgreSQLConnectionUrl() +
Configuration.getRsDbName());
SQLReportDataFactory dataFactory = new SQLReportDataFactory(provider);
dataFactory.setQuery("default", _query);
dataFactory.setQuery("sub1",
"SELECT url AS \"URL\"," +
"tran_time AS \"TRAN_TIME\"" +
" FROM trans WHERE" +
" url = ${TRANS_URL}");
report.setDataFactory(dataFactory);
If I limit the default query to return one row only, I get the report as desired with the sub report.
What is wrong? Why I can't get a reports with data and sub data for wach row?
Thanks in advance!