以xls格式导出​​报告,不带组adf中的列标题

时间:2013-08-02 11:50:56

标签: java-ee jasper-reports oracle-adf

我正在使用XLS格式的ADF应用程序生成jasper报告,但此报告存在两个问题:

  1. 合并了一些行和列。由于此聚合操作无法在xls报告中很好地执行。
  2. 一次又一次地重复列标题。
  3. 代码:

    else if( "xls".equalsIgnoreCase(reporttype) )
    {
        response.setContentType("application/xls");
        response.setHeader("Content-Disposition", "attachement; filename=\"TrialBalance_GroupWiseConsolidate.xls\"");
    
        exporter = new JRXlsExporter();                     
        exporter.setParameter(JRXlsExporterParameter.IS_DETECT_CELL_TYPE, Boolean.TRUE);
        exporter.setParameter(JRXlsExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.FALSE);
        exporter.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, Boolean.TRUE );
        exporter.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_COLUMNS, Boolean.TRUE );
        exporter.setParameter(JRXlsExporterParameter.IS_COLLAPSE_ROW_SPAN, Boolean.TRUE);
        exporter.setParameter(JRXlsExporterParameter.IS_IGNORE_GRAPHICS, Boolean.FALSE);
        exporter.setParameter(JRXlsExporterParameter.is, Boolean.FALSE);
    
        exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
        exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, ouputStream);
    }
    

1 个答案:

答案 0 :(得分:0)

第二点:

在xml中添加以下属性:

<property name="net.sf.jasperreports.export.xls.exclude.origin.keep.first.band.1" value="pageHeader"/>

您也可以删除其他乐队,只需添加一个属性,其值为删除页脚:

<property name="net.sf.jasperreports.export.xls.exclude.origin.band.4" value="pageFooter"/>

这将删除xls的所有页面中的页脚。

如需进一步参考,请查看here

相关问题