First time here? Check out the FAQ!
![]() | 1 | initial version | |
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.