0

Connection leak while generating jasper report

asked 2012-07-12 12:52:51 +0800

javaenthu gravatar image javaenthu
141 2

Hi,
From my composer code I am setting the dbConnection to the jasper report.
Report is getting generated nicely but I see ZK is not closing the connection.
I am using zk version 5.0.9 , zkex : 5.0.5 , jasper reports jar version : 4.5.1 and poi version 3.7, iText : 2.1.7

Thanks in advance!
-JE

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2012-07-23 10:48:14 +0800

javaenthu gravatar image javaenthu
141 2

updated 2012-07-23 10:58:53 +0800

I am taking the reference from ZK Jasper Demo.

precisely code is something like this :

<zk>
Choice the file type : <listbox id="format" mold="select" onSelect="showReport()" >
<listitem label="PDF" value="pdf" selected="true" />
<listitem label="XML" value="xml" />
<listitem label="HTML" value="html" />
<listitem label="Word (RTF)" value="rtf" />
<listitem label="Excel" value="xls" />
<listitem label="Excel (JXL)" value="jxl" />
<listitem label="CSV" value="csv" />
<listitem label="OpenOffice (ODT)" value="odt" unless="false"/>
</listbox>
<button label="Report!" onClick='showReport()'/>
<jasperreport id="report" height="360px" />

<zscript>
import org.zkoss.zksandbox.CustomDataSource;

void showReport() {
//Preparing parameters
Map parameters = new HashMap();
parameters.put("ReportTitle", "Address Report");
parameters.put("DataFile", "CustomDataSource from java");

report.setSrc("/data/jasperreport.jasper");
report.setParameters(parameters);
report.setDatasource(new CustomDataSource());
report.setType((String) format.getSelectedItem().getValue());
}
</zscript>
</zk>

Only thing is I have moved connection related things to composer.

Any workaround this?

Thanks in advance.
-JE.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2012-07-12 12:52:51 +0800

Seen: 141 times

Last updated: Jul 23 '12

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More