Java 类net.sf.jasperreports.engine.export.JRXlsExporter 实例源码

项目:jasperreports    文件:XChartApp.java   
/**
 *
 */
public void xls() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/XYChart.jrprint");

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

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

    JRXlsExporter exporter = new JRXlsExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
    SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
    configuration.setOnePagePerSheet(true);
    exporter.setConfiguration(configuration);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
项目:bdf2    文件:XlsExporter.java   
public void export(HttpServletRequest req, HttpServletResponse res) throws Exception {
    String fileName=this.getExportFileName(req);
    fileName+=".xls";
    res.setContentType("application/octet-stream");
    res.setHeader("Connection", "close");
    res.setHeader("Content-Disposition", "attachment;filename=\"" + new String(fileName.getBytes("utf-8"),"ISO-8859-1") + "\"");
    JRXlsExporter exporter = new JRXlsExporter(DefaultJasperReportsContext.getInstance());
    JasperPrint jasperPrint=this.getJasperPrint(req);
    exporter.setParameter(JRExporterParameter.JASPER_PRINT,jasperPrint);
    OutputStream ouputStream = res.getOutputStream();
    exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, ouputStream);
    try {
        exporter.exportReport();
    } catch (JRException e) {
        throw new ServletException(e);
    } finally {
        if (ouputStream != null) {
            ouputStream.flush();
            ouputStream.close();
        }
    }
}
项目:jasperreports    文件:Barcode4JApp.java   
/**
 *
 */
public void xls() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/Barcode4JReport.jrprint");

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

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

    JRXlsExporter exporter = new JRXlsExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
    SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
    configuration.setOnePagePerSheet(true);
    exporter.setConfiguration(configuration);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:JFreeChartApp.java   
/**
 *
 */
public void xls() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/JFreeChartReport.jrprint");

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

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

    JRXlsExporter exporter = new JRXlsExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
    SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
    configuration.setOnePagePerSheet(true);
    exporter.setConfiguration(configuration);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
项目:openbravo-brazil    文件:ReportingUtils.java   
/**
 * Generates an XLS report from a pre-compiled report and returns it into a file.
 * 
 * @param jasperPrint
 *          JasperPrint object which contains a compiled report.
 * @param exportParameters
 *          Export parameters than can be added to configure the resulting report.
 * @param file
 *          The file used to return the report.
 * @throws JRException
 *           In case there is any error generating the report an exception is thrown with the
 *           error message.
 */
private static void saveExcelReportToFile(JasperPrint jasperPrint,
    Map<Object, Object> exportParameters, File file) throws JRException {
  final JRXlsExporter excelExporter = new JRXlsExporter();
  SimpleExporterInput exporterInput = new SimpleExporterInput(jasperPrint);
  SimpleOutputStreamExporterOutput exporterOutput = new SimpleOutputStreamExporterOutput(file);

  if (exportParameters != null && exportParameters.size() > 0) {
    SimpleXlsReportConfiguration exportConfiguration = getXlsConfigurationFromExportParameters(exportParameters);
    excelExporter.setConfiguration(exportConfiguration);
  } else {
    SimpleXlsReportConfiguration reportExportConfiguration = new SimpleXlsReportConfiguration();
    reportExportConfiguration.setOnePagePerSheet(false);
    reportExportConfiguration.setRemoveEmptySpaceBetweenRows(true);
    excelExporter.setConfiguration(reportExportConfiguration);
  }
  excelExporter.setExporterInput(exporterInput);
  excelExporter.setExporterOutput(exporterOutput);
  excelExporter.exportReport();
}
项目:openbravo-brazil    文件:ReportingUtils.java   
/**
 * Generates an XLS report from a pre-compiled report and returns it into an output stream.
 * 
 * @param jasperPrint
 *          JasperPrint object which contains a compiled report.
 * @param exportParameters
 *          Export parameters than can be added to configure the resulting report.
 * @param outputStream
 *          The output stream used to return the report.
 * @throws JRException
 *           In case there is any error generating the report an exception is thrown with the
 *           error message.
 */
private static void saveExcelReportToOutputStream(JasperPrint jasperPrint,
    Map<Object, Object> exportParameters, OutputStream outputStream) throws JRException {
  final JRXlsExporter excelExporter = new JRXlsExporter();
  SimpleExporterInput exporterInput = new SimpleExporterInput(jasperPrint);
  SimpleOutputStreamExporterOutput exporterOutput = new SimpleOutputStreamExporterOutput(
      outputStream);

  if (exportParameters != null && exportParameters.size() > 0) {
    SimpleXlsReportConfiguration exportConfiguration = getXlsConfigurationFromExportParameters(exportParameters);
    excelExporter.setConfiguration(exportConfiguration);
  } else {
    SimpleXlsReportConfiguration reportExportConfiguration = new SimpleXlsReportConfiguration();
    reportExportConfiguration.setOnePagePerSheet(false);
    reportExportConfiguration.setRemoveEmptySpaceBetweenRows(true);
    excelExporter.setConfiguration(reportExportConfiguration);
  }
  excelExporter.setExporterInput(exporterInput);
  excelExporter.setExporterOutput(exporterOutput);
  excelExporter.exportReport();
}
项目:jasperreports    文件:UnicodeApp.java   
/**
 *
 */
public void xls() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/UnicodeReport.jrprint");

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

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

    JRXlsExporter exporter = new JRXlsExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
    SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
    configuration.setOnePagePerSheet(true);
    exporter.setConfiguration(configuration);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:DataSourceApp.java   
/**
 *
 */
public void xls() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/DataSourceReport.jrprint");

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

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

    JRXlsExporter exporter = new JRXlsExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
    SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
    configuration.setOnePagePerSheet(false);
    exporter.setConfiguration(configuration);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:FontsApp.java   
/**
 *
 */
public void xls() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/FontsReport.jrprint");

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

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

    JRXlsExporter exporter = new JRXlsExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
    SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
    configuration.setOnePagePerSheet(false);
    exporter.setConfiguration(configuration);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:FormsApp.java   
/**
 *
 */
public void xls() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/FormsReport.jrprint");

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

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

    JRXlsExporter exporter = new JRXlsExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
    SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
    configuration.setOnePagePerSheet(true);
    exporter.setConfiguration(configuration);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:StyledTextApp.java   
/**
 *
 */
public void xls() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/StyledTextReport.jrprint");

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

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

    JRXlsExporter exporter = new JRXlsExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
    SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
    configuration.setOnePagePerSheet(false);
    exporter.setConfiguration(configuration);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:MapApp.java   
/**
 *
 */
public void xls() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/MapReport.jrprint");

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

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

    JRXlsExporter exporter = new JRXlsExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
    SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
    configuration.setOnePagePerSheet(true);
    exporter.setConfiguration(configuration);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:TabularApp.java   
/**
 *
 */
public void xls() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/TabularReport.jrprint");

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

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

    JRXlsExporter exporter = new JRXlsExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
    SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
    configuration.setOnePagePerSheet(false);
    exporter.setConfiguration(configuration);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:QueryApp.java   
/**
 *
 */
public void xls() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/QueryReport.jrprint");

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

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

    JRXlsExporter exporter = new JRXlsExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
    SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
    configuration.setOnePagePerSheet(false);
    exporter.setConfiguration(configuration);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:ShapesApp.java   
/**
 *
 */
public void xls() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/ShapesReport.jrprint");

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

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

    JRXlsExporter exporter = new JRXlsExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
    SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
    configuration.setOnePagePerSheet(false);
    exporter.setConfiguration(configuration);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:XmlDataSourceApp.java   
/**
 *
 */
public void xls() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/CustomersReport.jrprint");

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

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

    JRXlsExporter exporter = new JRXlsExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
    SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
    configuration.setOnePagePerSheet(true);
    exporter.setConfiguration(configuration);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:SubreportApp.java   
/**
 *
 */
public void xls() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/MasterReport.jrprint");

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

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

    JRXlsExporter exporter = new JRXlsExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
    SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
    configuration.setOnePagePerSheet(true);
    exporter.setConfiguration(configuration);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:NoXmlDesignApp.java   
/**
 *
 */
public void xls() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/NoXmlDesignReport.jrprint");

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

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

    JRXlsExporter exporter = new JRXlsExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
    SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
    configuration.setOnePagePerSheet(false);
    exporter.setConfiguration(configuration);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:ListApp.java   
/**
 *
 */
public void xls() throws JRException
{
    File[] files = getFiles(new File("build/reports"), "jrprint");
    for(int i = 0; i < files.length; i++)
    {
        long start = System.currentTimeMillis();
        File sourceFile = files[i];

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

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

        JRXlsExporter exporter = new JRXlsExporter();

        exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
        exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
        SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
        configuration.setOnePagePerSheet(true);
        exporter.setConfiguration(configuration);

        exporter.exportReport();

        System.err.println("Report : " + sourceFile + ". XLS creation time : " + (System.currentTimeMillis() - start));
    }
}
项目:jasperreports    文件:NoPageBreakApp.java   
/**
 *
 */
public void xls() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/NoPageBreakReport.jrprint");

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

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

    JRXlsExporter exporter = new JRXlsExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
    SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
    configuration.setOnePagePerSheet(false);
    configuration.setRemoveEmptySpaceBetweenRows(true);
    exporter.setConfiguration(configuration);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:XlsDataSourceApp.java   
/**
 *
 */
public void xls() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/XlsDataSourceReport.jrprint");

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

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

    JRXlsExporter exporter = new JRXlsExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
    SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
    configuration.setOnePagePerSheet(false);
    exporter.setConfiguration(configuration);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:HorizontalApp.java   
/**
 *
 */
public void xls() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/HorizontalReport.jrprint");

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

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

    JRXlsExporter exporter = new JRXlsExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
    SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
    configuration.setOnePagePerSheet(true);
    exporter.setConfiguration(configuration);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:HyperlinkApp.java   
/**
 *
 */
public void xls() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/HyperlinkReport.jrprint");

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

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

    JRXlsExporter exporter = new JRXlsExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
    SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
    configuration.setOnePagePerSheet(true);
    exporter.setConfiguration(configuration);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:MarkupApp.java   
/**
 *
 */
public void xls() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/MarkupReport.jrprint");

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

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

    JRXlsExporter exporter = new JRXlsExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
    SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
    configuration.setOnePagePerSheet(false);
    exporter.setConfiguration(configuration);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:StylesApp.java   
/**
 *
 */
public void xls() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/StylesReport.jrprint");

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

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

    JRXlsExporter exporter = new JRXlsExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
    SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
    configuration.setOnePagePerSheet(false);
    exporter.setConfiguration(configuration);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:ImagesApp.java   
/**
 *
 */
public void xls() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/ImagesReport.jrprint");

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

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

    JRXlsExporter exporter = new JRXlsExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
    SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
    configuration.setOnePagePerSheet(false);
    exporter.setConfiguration(configuration);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:CrosstabApp.java   
/**
 *
 */
public void xls() throws JRException
{
    File[] files = getFiles(new File("build/reports"), "jrprint");
    for(int i = 0; i < files.length; i++)
    {
        long start = System.currentTimeMillis();
        File sourceFile = files[i];

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

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

        JRXlsExporter exporter = new JRXlsExporter();

        exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
        exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
        SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
        configuration.setOnePagePerSheet(true);
        exporter.setConfiguration(configuration);

        exporter.exportReport();

        System.err.println("Report : " + sourceFile + ". XLS creation time : " + (System.currentTimeMillis() - start));
    }
}
项目:jasperreports    文件:JsonDataSourceApp.java   
/**
 *
 */
public void xls() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/JsonCustomersReport.jrprint");

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

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

    JRXlsExporter exporter = new JRXlsExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
    SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
    configuration.setOnePagePerSheet(true);
    exporter.setConfiguration(configuration);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:ChartThemesApp.java   
/**
 *
 */
public void xls() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/AllChartsReport.jrprint");
    Map<String, String> dateFormats = new HashMap<String, String>();
    dateFormats.put("EEE, MMM d, yyyy", "ddd, mmm d, yyyy");
    JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile);
    File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".xls");

    JRXlsExporter exporter = new JRXlsExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
    SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
    configuration.setOnePagePerSheet(true);
    configuration.setDetectCellType(true);
    configuration.setFormatPatternsMap(dateFormats);
    exporter.setConfiguration(configuration);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:BarbecueApp.java   
/**
 *
 */
public void xls() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/BarbecueReport.jrprint");

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

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

    JRXlsExporter exporter = new JRXlsExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
    SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
    configuration.setOnePagePerSheet(true);
    exporter.setConfiguration(configuration);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:XChartApp.java   
/**
 *
 */
public void xls() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/XChartReport.jrprint");

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

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

    JRXlsExporter exporter = new JRXlsExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
    SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
    configuration.setOnePagePerSheet(true);
    exporter.setConfiguration(configuration);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:IconLabelApp.java   
/**
 *
 */
public void xls() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/IconLabelReport.jrprint");

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

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

    JRXlsExporter exporter = new JRXlsExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
    SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
    configuration.setOnePagePerSheet(true);
    exporter.setConfiguration(configuration);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:StretchApp.java   
/**
 *
 */
public void xls() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/StretchReport.jrprint");

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

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

    JRXlsExporter exporter = new JRXlsExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
    SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
    configuration.setOnePagePerSheet(false);
    configuration.setFontSizeFixEnabled(true);
    exporter.setConfiguration(configuration);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:SpiderChartApp.java   
/**
 *
 */
public void xls() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/SpiderChart.jrprint");

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

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

    JRXlsExporter exporter = new JRXlsExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
    SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
    configuration.setOnePagePerSheet(true);
    exporter.setConfiguration(configuration);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:ParagraphsApp.java   
/**
 *
 */
public void xls() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/ParagraphsReport.jrprint");

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

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

    JRXlsExporter exporter = new JRXlsExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
    SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
    configuration.setOnePagePerSheet(false);
    exporter.setConfiguration(configuration);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:HibernateApp.java   
/**
 *
 */
public void xls() throws JRException
{
    File[] files = getFiles(new File("build/reports"), "jrprint");
    for(int i = 0; i < files.length; i++)
    {
        long start = System.currentTimeMillis();
        File sourceFile = files[i];

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

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

        JRXlsExporter exporter = new JRXlsExporter();

        exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
        exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
        SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
        configuration.setOnePagePerSheet(true);
        exporter.setConfiguration(configuration);

        exporter.exportReport();

        System.err.println("Report : " + sourceFile + ". XLS creation time : " + (System.currentTimeMillis() - start));
    }
}
项目:jasperreports    文件:TableApp.java   
/**
 *
 */
public void xls() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/TableReport.jrprint");

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

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

    JRXlsExporter exporter = new JRXlsExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
    SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
    configuration.setOnePagePerSheet(false);
    exporter.setConfiguration(configuration);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:NoReportApp.java   
/**
 *
 */
public void xls() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/NoReport.jrprint");

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

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

    JRXlsExporter exporter = new JRXlsExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
    SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
    configuration.setOnePagePerSheet(true);
    exporter.setConfiguration(configuration);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:TableOfContentsApp.java   
/**
 *
 */
public void xls() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/TableOfContentsReport.jrprint");

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

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

    JRXlsExporter exporter = new JRXlsExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
    SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
    configuration.setOnePagePerSheet(true);
    exporter.setConfiguration(configuration);

    exporter.exportReport();

    System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:RotationApp.java   
/**
 *
 */
public void xls() throws JRException
{
    long start = System.currentTimeMillis();
    File sourceFile = new File("build/reports/RotationReport.jrprint");

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

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

    JRXlsExporter exporter = new JRXlsExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
    SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
    configuration.setOnePagePerSheet(false);
    exporter.setConfiguration(configuration);

    exporter.exportReport();

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