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

项目:bdf2    文件:RtfExporter.java   
public void export(HttpServletRequest req, HttpServletResponse res) throws Exception {
    String fileName=this.getExportFileName(req);
    fileName+=".rtf";
    res.setContentType("application/octet-stream");
    res.setHeader("Connection", "close");
    res.setHeader("Content-Disposition", "attachment;filename=\"" + new String(fileName.getBytes("utf-8"),"ISO-8859-1") + "\"");
    JRRtfExporter exporter = new JRRtfExporter(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    文件:ListApp.java   
/**
 *
 */
public void rtf() 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() + ".rtf");

        JRRtfExporter exporter = new JRRtfExporter();

        exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
        exporter.setExporterOutput(new SimpleWriterExporterOutput(destFile));

        exporter.exportReport();

        System.err.println("Report : " + sourceFile + ". RTF creation time : " + (System.currentTimeMillis() - start));
    }
}
项目:jasperreports    文件:CsvDataSourceApp.java   
/**
 *
 */
public void rtf() 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() + ".rtf");

        JRRtfExporter exporter = new JRRtfExporter();

        exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
        exporter.setExporterOutput(new SimpleWriterExporterOutput(destFile));

        exporter.exportReport();

        System.err.println("Report : " + sourceFile + ". RTF creation time : " + (System.currentTimeMillis() - start));
    }
}
项目:jasperreports    文件:CrosstabApp.java   
/**
 *
 */
public void rtf() 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() + ".rtf");

        JRRtfExporter exporter = new JRRtfExporter();

        exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
        exporter.setExporterOutput(new SimpleWriterExporterOutput(destFile));

        exporter.exportReport();

        System.err.println("Report : " + sourceFile + ". RTF creation time : " + (System.currentTimeMillis() - start));
    }
}
项目:jasperreports    文件:HibernateApp.java   
/**
 *
 */
public void rtf() 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() + ".rtf");

        JRRtfExporter exporter = new JRRtfExporter();

        exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
        exporter.setExporterOutput(new SimpleWriterExporterOutput(destFile));

        exporter.exportReport();

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

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

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

    JRRtfExporter exporter = new JRRtfExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleWriterExporterOutput(destFile));
    SimpleRtfReportConfiguration configuration = new SimpleRtfReportConfiguration();
    configuration.setProgressMonitor(new SimpleExportProgressMonitor());
    exporter.setConfiguration(configuration);

    exporter.exportReport();

    System.err.println("RTF creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:BatchExportApp.java   
/**
 *
 */
public void rtf() throws JRException
{
    long start = System.currentTimeMillis();
    List<JasperPrint> jasperPrintList = new ArrayList<JasperPrint>();
    jasperPrintList.add((JasperPrint)JRLoader.loadObjectFromFile("build/reports/Report1.jrprint"));
    jasperPrintList.add((JasperPrint)JRLoader.loadObjectFromFile("build/reports/Report2.jrprint"));
    jasperPrintList.add((JasperPrint)JRLoader.loadObjectFromFile("build/reports/Report3.jrprint"));

    JRRtfExporter exporter = new JRRtfExporter();

    exporter.setExporterInput(SimpleExporterInput.getInstance(jasperPrintList));
    exporter.setExporterOutput(new SimpleWriterExporterOutput("build/reports/BatchExportReport.rtf"));

    exporter.exportReport();

    System.err.println("RTF creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:MondrianApp.java   
/**
 *
 */
public void rtf() 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() + ".rtf");

        JRRtfExporter exporter = new JRRtfExporter();

        exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
        exporter.setExporterOutput(new SimpleWriterExporterOutput(destFile));

        exporter.exportReport();

        System.err.println("Report : " + sourceFile + ". RTF creation time : " + (System.currentTimeMillis() - start));
    }
}
项目:jasperreports    文件:MapElementRtfHandler.java   
@Override
public void exportElement(
    JRRtfExporterContext exporterContext,
    JRGenericPrintElement element
    )
{
    try
    {
        JRRtfExporter exporter = (JRRtfExporter)exporterContext.getExporterRef();
        exporter.exportImage(MapElementImageProvider.getImage(exporterContext.getJasperReportsContext(), element));
    }
    catch (Exception e)
    {
        throw new RuntimeException(e);
    }
}
项目:engerek    文件:ReportCreateTaskHandler.java   
private Exporter createExporter(ExportType type) {
    switch (type) {
        case CSV:
            return new JRCsvExporter();
        case RTF:
            return new JRRtfExporter();
        case XLS:
            return new JRXlsExporter();
        case ODT:
            return new JROdtExporter();
        case ODS:
            return new JROdsExporter();
        case DOCX:
            return new JRDocxExporter();
        case XLSX:
            return new JRXlsxExporter();
        case PPTX:
            return new JRPptxExporter();
        default:
            return null;
    }
}
项目:nextreports-server    文件:JasperReportsUtil.java   
public static byte[] getRtf(JasperPrint jasperPrint) throws JRException {
    byte[] content = null;
    ByteArrayOutputStream baos = null;
    try {
        baos = new ByteArrayOutputStream();
        JRRtfExporter exporter = new JRRtfExporter();
        content = getBytes(exporter, baos, jasperPrint);
    } finally {
        if (baos != null) {
            try {
                baos.flush();
                baos.close();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
    return content;
}
项目:jasperreports    文件:JRRtfSaveContributor.java   
@Override
public void save(JasperPrint jasperPrint, File file) throws JRException
{
    if(!file.getName().toLowerCase().endsWith(EXTENSION_RTF))
    {
        file = new File(file.getAbsolutePath() + EXTENSION_RTF);
    }

    if (
        !file.exists() ||
        JOptionPane.OK_OPTION == 
            JOptionPane.showConfirmDialog(
                null, 
                MessageFormat.format(
                    getBundleString("file.exists"),
                    new Object[]{file.getName()}
                    ), 
                getBundleString("save"), 
                JOptionPane.OK_CANCEL_OPTION
                )
        )
    {
        JRRtfExporter exporter = new JRRtfExporter(getJasperReportsContext());
        exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); 
        exporter.setExporterOutput(new SimpleWriterExporterOutput(file));
        exporter.exportReport();
    }
}
项目:jasperstarter    文件:Report.java   
public void exportRtf() throws JRException {
    JRRtfExporter exporter = new JRRtfExporter();
    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleWriterExporterOutput(this.output
            .getAbsolutePath() + ".rtf"));
    exporter.exportReport();
}
项目:PDFReporter-Studio    文件:ExportAsRtfAction.java   
@Override
protected JRRtfExporter getExporter(JasperReportsConfiguration jContext, JRExportProgressMonitor monitor, File file) {
    JRRtfExporter exp = new JRRtfExporter(jContext);
    exp.setExporterOutput(new SimpleWriterExporterOutput(file));

    SimpleRtfReportConfiguration rconf = new SimpleRtfReportConfiguration();
    setupReportConfiguration(rconf, monitor);
    exp.setConfiguration(rconf);

    return exp;
}
项目:io-addon    文件:JasperRenderer.java   
/**
 * Exports by MIME type.
 *
 * @param mimeType MIME type
 * @param jp       Jasper print
 * @param os       outputstream
 * @throws JRException
 */
protected void export(String mimeType, JasperPrint jp, OutputStream os) throws JRException {
    if ("application/pdf".equalsIgnoreCase(mimeType)) {
        exportReport(new JRPdfExporter(), jp, os);

    } else if ("text/xml".equalsIgnoreCase(mimeType)) {
        exportReport(new HtmlExporter(), jp, os);

    } else if ("application/rtf".equalsIgnoreCase(mimeType)) {
        exportReport(new JRRtfExporter(), jp, os);

    } else if ("application/xls".equalsIgnoreCase(mimeType)) {
        exportReport(new JRXlsExporter(), jp, os);

    } else if ("application/odt".equalsIgnoreCase(mimeType)) {
        exportReport(new JROdtExporter(), jp, os);

    } else if ("application/ods".equalsIgnoreCase(mimeType)) {
        exportReport(new JROdsExporter(), jp, os);

    } else if ("application/docx".equalsIgnoreCase(mimeType)) {
        exportReport(new JRDocxExporter(), jp, os);

    } else if ("application/xlsx".equalsIgnoreCase(mimeType)) {
        exportReport(new JRXlsxExporter(), jp, os);

    } else if ("application/pptx".equalsIgnoreCase(mimeType)) {
        exportReport(new JRPptxExporter(), jp, os);

    } else if ("text/xhmtl".equalsIgnoreCase(mimeType)) {
        exportReport(new JRXhtmlExporter(), jp, os);
    } else {
        throw new IllegalArgumentException("JasperRenderer does not support " + mimeType + " MIME type.");
    }
}
项目:jasper-service    文件:JasperProcess.java   
protected void rtf(JasperPrint print, String destFile) throws JRException, IOException {
    log.debug("exporting to rtf file: " + destFile);
    JRRtfExporter exporter = new JRRtfExporter();
exporter.setExporterInput(new SimpleExporterInput(print));
exporter.setExporterOutput(new SimpleWriterExporterOutput(destFile));
exporter.exportReport();
 }
项目:gnvc-ims    文件:OOReportGenerator.java   
private void exportToRTF() {
    log.debug("exporting to RTF");
    rtfExporter = new JRRtfExporter();
    rtfExporter.setParameters(getExportParameters());
    try {
        start = System.currentTimeMillis();
        rtfExporter.exportReport();
        log.info("export running time (msec): "
                + (System.currentTimeMillis() - start));
    } catch (JRException jre) {
        jre.printStackTrace();
        log.error(jre.getCause());
    }
}
项目:dynamicreports-jasper    文件:ExporterTransform.java   
private JRRtfExporter rtf(JasperIRtfExporter jasperExporter) {
    SimpleWriterExporterOutput exporterOutput = simpleWriterExporterOutput(jasperExporter);
    SimpleRtfReportConfiguration reportExportConfiguration = new SimpleRtfReportConfiguration();
    reportExportConfiguration(reportExportConfiguration, jasperExporter);
    if (jasperExporter.getIgnoreHyperLink() != null) {
        reportExportConfiguration.setIgnoreHyperlink(jasperExporter.getIgnoreHyperLink());
    }
    SimpleRtfExporterConfiguration exporterConfiguration = new SimpleRtfExporterConfiguration();

    JRRtfExporter jrExporter = new JRRtfExporter();
    jrExporter.setExporterOutput(exporterOutput);
    jrExporter.setConfiguration(reportExportConfiguration);
    jrExporter.setConfiguration(exporterConfiguration);
    return jrExporter;
}
项目:jasperreports-wms-component    文件:WmsMapElementRtfHandler.java   
@Override
public void exportElement(JRRtfExporterContext exporterContext,
    JRGenericPrintElement element) {
  try {
    JRRtfExporter exporter = (JRRtfExporter) exporterContext.getExporter();
    JRPrintImage image = WmsMapElementImageProvider.getImage(
        exporterContext.getJasperReportsContext(), element);
    exporter.exportImage(image);
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
}
项目:jasperreports    文件:UnicodeApp.java   
/**
 *
 */
public void rtf() 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() + ".rtf");

    JRRtfExporter exporter = new JRRtfExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleWriterExporterOutput(destFile));

    exporter.exportReport();

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

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

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

    JRRtfExporter exporter = new JRRtfExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleWriterExporterOutput(destFile));

    exporter.exportReport();

    System.err.println("RTF creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:Barcode4JApp.java   
/**
 *
 */
public void rtf() 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() + ".rtf");

    JRRtfExporter exporter = new JRRtfExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleWriterExporterOutput(destFile));

    exporter.exportReport();

    System.err.println("RTF creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:DataSourceApp.java   
/**
 *
 */
public void rtf() 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() + ".rtf");

    JRRtfExporter exporter = new JRRtfExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleWriterExporterOutput(destFile));

    exporter.exportReport();

    System.err.println("RTF creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:FontsApp.java   
/**
 *
 */
public void rtf() 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() + ".rtf");

    JRRtfExporter exporter = new JRRtfExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleWriterExporterOutput(destFile));

    exporter.exportReport();

    System.err.println("RTF creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:FormsApp.java   
/**
 *
 */
public void rtf() 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() + ".rtf");

    JRRtfExporter exporter = new JRRtfExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleWriterExporterOutput(destFile));

    exporter.exportReport();

    System.err.println("RTF creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:StyledTextApp.java   
/**
 *
 */
public void rtf() 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() + ".rtf");

    JRRtfExporter exporter = new JRRtfExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleWriterExporterOutput(destFile));

    exporter.exportReport();

    System.err.println("RTF creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:MapApp.java   
/**
 *
 */
public void rtf() 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() + ".rtf");

    JRRtfExporter exporter = new JRRtfExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleWriterExporterOutput(destFile));

    exporter.exportReport();

    System.err.println("RTF creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:TabularApp.java   
/**
 *
 */
public void rtf() 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() + ".rtf");

    JRRtfExporter exporter = new JRRtfExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleWriterExporterOutput(destFile));

    exporter.exportReport();

    System.err.println("RTF creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:XChartApp.java   
/**
 *
 */
public void rtf() 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() + ".rtf");

    JRRtfExporter exporter = new JRRtfExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleWriterExporterOutput(destFile));

    exporter.exportReport();

    System.err.println("RTF creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:QueryApp.java   
/**
 *
 */
public void rtf() 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() + ".rtf");

    JRRtfExporter exporter = new JRRtfExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleWriterExporterOutput(destFile));

    exporter.exportReport();

    System.err.println("RTF creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:ShapesApp.java   
/**
 *
 */
public void rtf() 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() + ".rtf");

    JRRtfExporter exporter = new JRRtfExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleWriterExporterOutput(destFile));

    exporter.exportReport();

    System.err.println("RTF creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:XmlDataSourceApp.java   
/**
 *
 */
public void rtf() 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() + ".rtf");

    JRRtfExporter exporter = new JRRtfExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleWriterExporterOutput(destFile));

    exporter.exportReport();

    System.err.println("RTF creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:SubreportApp.java   
/**
 *
 */
public void rtf() 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() + ".rtf");

    JRRtfExporter exporter = new JRRtfExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleWriterExporterOutput(destFile));

    exporter.exportReport();

    System.err.println("RTF creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:NoXmlDesignApp.java   
/**
 *
 */
public void rtf() 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() + ".rtf");

    JRRtfExporter exporter = new JRRtfExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleWriterExporterOutput(destFile));

    exporter.exportReport();

    System.err.println("RTF creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:NoPageBreakApp.java   
/**
 *
 */
public void rtf() 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() + ".rtf");

    JRRtfExporter exporter = new JRRtfExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleWriterExporterOutput(destFile));

    exporter.exportReport();

    System.err.println("RTF creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:XlsDataSourceApp.java   
/**
 *
 */
public void rtf() 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() + ".rtf");

    JRRtfExporter exporter = new JRRtfExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleWriterExporterOutput(destFile));

    exporter.exportReport();

    System.err.println("RTF creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:HorizontalApp.java   
/**
 *
 */
public void rtf() 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() + ".rtf");

    JRRtfExporter exporter = new JRRtfExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleWriterExporterOutput(destFile));

    exporter.exportReport();

    System.err.println("RTF creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:HyperlinkApp.java   
/**
 *
 */
public void rtf() 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() + ".rtf");

    JRRtfExporter exporter = new JRRtfExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleWriterExporterOutput(destFile));

    exporter.exportReport();

    System.err.println("RTF creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:MarkupApp.java   
/**
 *
 */
public void rtf() 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() + ".rtf");

    JRRtfExporter exporter = new JRRtfExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleWriterExporterOutput(destFile));

    exporter.exportReport();

    System.err.println("RTF creation time : " + (System.currentTimeMillis() - start));
}
项目:jasperreports    文件:StylesApp.java   
/**
 *
 */
public void rtf() 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() + ".rtf");

    JRRtfExporter exporter = new JRRtfExporter();

    exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
    exporter.setExporterOutput(new SimpleWriterExporterOutput(destFile));

    exporter.exportReport();

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