【问题标题】:Mixed page orientation in JasperReportsJasperReports 中的混合页面方向
【发布时间】:2013-09-23 18:15:59
【问题描述】:

我正在使用 VaadinJasperReports 开发我的第一个应用程序。我有以下麻烦,我必须提取以这种方式组成的 .rtf 文档:

第一页必须是垂直方向,第二页必须是水平方向

现在我正在尝试以这种方式解决这个问题:

    JasperCompileManager.compileReportToFile(pathFirstJrxml ,pathFirstJasper );  
    JasperCompileManager.compileReportToFile(pathSecondJrxml ,pathSecondJasper ); 

    File fileFirstReport = new File(pathFirstJasper);
    File fileSecondReport = new File(pathSecondJasper);

    JasperPrint jasperPrint = JasperFillManager.fillReport((JasperReport)JRLoader.loadObject(fileFirstReport),null,dataSourceFirstReport);
    JasperPrint jasperPrintSubReport = JasperFillManager.fillReport((JasperReport)JRLoader.loadObject(fileSecondReport),null,dataSourceSecondReport);

    List list = new ArrayList(); 
    list.add(jasperPrint);
    list.add( jasperPrintSubReport );

    JRRtfExporter rtfExporter = new JRRtfExporter();
    rtfExporter.setParameter(JRExporterParameter.JASPER_PRINT_LIST, list);
    rtfExporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME,pathOutputFile);
    System.out.println("Exporting report...");   
    rtfExporter.exportReport();
    System.out.println("Done!");

我创建了两个 jrxml 文件,第一个是垂直方向的,第二个是水平方向的,但这不起作用。输出文件具有水平方向。

我哪里错了?

【问题讨论】:

    标签: java jasper-reports


    【解决方案1】:

    我将导出器从 rtfExporter 更改为 docxExporter,现在一切正常

    【讨论】:

      猜你喜欢
      • 2012-10-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-07-23
      • 1970-01-01
      • 1970-01-01
      • 2011-11-26
      • 1970-01-01
      相关资源
      最近更新 更多