Package net.sf.jasperreports.engine.export

Examples of net.sf.jasperreports.engine.export.JExcelApiExporter


    JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile);

    File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".jxl.xls");

    JExcelApiExporter exporter = new JExcelApiExporter();

    exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
    exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, destFile.toString());
    exporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
  }
View Full Code Here


      JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile);

      File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".jxl.xls");
   
      JExcelApiExporter exporter = new JExcelApiExporter();
   
      exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
      exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, destFile.toString());
      exporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE);
   
      exporter.exportReport();

      System.err.println("Report : " + sourceFile + ". XLS creation time : " + (System.currentTimeMillis() - start));
    }
  }
View Full Code Here

    JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile);

    File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".jxl.xls");

    JExcelApiExporter exporter = new JExcelApiExporter();

    exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
    exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, destFile.toString());
    exporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
  }
View Full Code Here

    JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile);

    File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".jxl.xls");

    JExcelApiExporter exporter = new JExcelApiExporter();

    exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
    exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, destFile.toString());
    exporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
  }
View Full Code Here

    JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile);

    File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".jxl.xls");
   
    JExcelApiExporter exporter = new JExcelApiExporter();
   
    exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
    exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, destFile.toString());
    exporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE);
   
    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
  }
View Full Code Here

    JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile);

    File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".jxl.xls");

    JExcelApiExporter exporter = new JExcelApiExporter();

    exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
    exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, destFile.toString());
    exporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
  }
View Full Code Here

    JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile);

    File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".jxl.xls");

    JExcelApiExporter exporter = new JExcelApiExporter();

    exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
    exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, destFile.toString());
    exporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE);
    exporter.setParameter(JRXlsExporterParameter.IS_FONT_SIZE_FIX_ENABLED, Boolean.TRUE);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
  }
View Full Code Here

            if (jp.getPages().size() < 1) {
                throw new ViewHandlerException("Report is Empty (no results?)");
            } else {
                Debug.logInfo("Got report, there are " + jp.getPages().size() + " pages.", module);
            }
           JExcelApiExporter exporter = new JExcelApiExporter();
           exporter.setParameter(JExcelApiExporterParameter.JASPER_PRINT, jp);
           exporter.setParameter(JExcelApiExporterParameter.OUTPUT_STREAM, response.getOutputStream());
           exporter.exportReport();

        } catch (IOException ie) {
            throw new ViewHandlerException("IO Error in report", ie);
        } catch (java.sql.SQLException e) {
            throw new ViewHandlerException("Database error while running report", e);
View Full Code Here

        {
          exporter = new JRXlsExporter();
        }
        else if (exportType == ExportType.EXCEL)
        {
          exporter = new JExcelApiExporter();
        }

        exporter.setParameter(
            JRXlsAbstractExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS,
            new Boolean(exportOptions.isXlsRemoveEmptySpaceBetweenRows()));
View Full Code Here

            // Remove the pageHeader from pages except starting page
            jasperPrint.setProperty("net.sf.jasperreports.export.xls.exclude.origin.keep.first.band.1", "pageHeader");
            //  Remove the pageFooter from all the pages
            jasperPrint.setProperty("net.sf.jasperreports.export.xls.exclude.origin.band.2", "pageFooter");
            //  set the JXL parameters to generate Excel report
            JExcelApiExporter jExcelApiExporter = new JExcelApiExporter();
            jExcelApiExporter.setParameter(JExcelApiExporterParameter.JASPER_PRINT, jasperPrint);
            jExcelApiExporter.setParameter(JExcelApiExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.FALSE);
            jExcelApiExporter.setParameter(JExcelApiExporterParameter.OUTPUT_STREAM, outputStream);
            jExcelApiExporter.setParameter(JExcelApiExporterParameter.IS_IGNORE_CELL_BORDER,Boolean.TRUE);
            jExcelApiExporter.setParameter(JExcelApiExporterParameter.IS_ONE_PAGE_PER_SHEET,Boolean.FALSE);
            jExcelApiExporter.setParameter(JExcelApiExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS,Boolean.TRUE);
            jExcelApiExporter.setParameter(JExcelApiExporterParameter.OFFSET_X,0);
            jExcelApiExporter.setParameter(JExcelApiExporterParameter.OFFSET_Y,0 );
            jExcelApiExporter.exportReport();

        } catch (JRException e) {
            throw new JRException("Error occurred exporting Excel report ", e);
        }
        return outputStream;
View Full Code Here

TOP

Related Classes of net.sf.jasperreports.engine.export.JExcelApiExporter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.