Revision history [back]

click to hide/show revision 1
initial version

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

javaenthu gravatar image javaenthu

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()" &gt;="" <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.

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