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

项目:PDFReporter-Studio    文件:AExportAction.java   
public void doExport(File file, JasperPrint jrPrint, final IProgressMonitor monitor) {
    try {
        if (jrPrint != null && jrPrint.getPages() != null) {
            final Integer size = jrPrint.getPages().size();
            monitor.beginTask(Messages.AExportAction_exportreport, size);
            exportWithProgress(file, new JRExportProgressMonitor() {
                private int current = 0;

                @Override
                public void afterPageExport() {
                    if (monitor.isCanceled())
                        Thread.currentThread().interrupt();
                    monitor.worked(1);
                    monitor.subTask(MessageFormat
                            .format(Messages.PageNumberContributionItem_page, new Integer(current++), size));
                }

            });
        }
    } catch (Throwable e) {
        UIUtils.showError(e);
    } finally {
        monitor.done();
    }
}
项目:PDFReporter-Studio    文件:ExportAsJasperReportsAction.java   
@Override
protected void exportWithProgress(File file, JRExportProgressMonitor monitor) throws Throwable {
    final java.io.File f = file.getAbsoluteFile();
    final Throwable[] ex = new Throwable[1];
    BusyIndicator.showWhile(null, new Runnable() {
        public void run() {
            try {
                JRSaver.saveObject(getReportViewer().getReport(), f);
            } catch (Throwable e) {
                ex[0] = e;
            }
        }
    });
    if (ex[0] != null)
        throw ex[0];
}
项目:VaadinUtils    文件:JasperManager.java   
private SimpleReportExportConfiguration getPageMonitorConfig(SimpleReportExportConfiguration context)
{
    context.setProgressMonitor(new JRExportProgressMonitor()
    {
        int pageCount = 0;

        @Override
        public void afterPageExport()
        {
            pageCount++;
            queueEntry.setStatus("Rendering page " + pageCount);

        }
    });
    return context;
}
项目:jasperreports    文件:JROdtExporter.java   
/**
 *
 */
protected void exportPage(JRPrintPage page) throws JRException, IOException
{
    startPage = true;

    ReportExportConfiguration configuration = getCurrentItemConfiguration();

    PrintPageFormat pageFormat = jasperPrint.getPageFormat(pageIndex);

    JRGridLayout layout =
        new JRGridLayout(
            nature,
            page.getElements(),
            pageFormat.getPageWidth(),
            pageFormat.getPageHeight(),
            configuration.getOffsetX() == null ? 0 : configuration.getOffsetX(), 
            configuration.getOffsetY() == null ? 0 : configuration.getOffsetY(),
            null //address
            );

    exportGrid(layout, null);

    JRExportProgressMonitor progressMonitor = configuration.getProgressMonitor();
    if (progressMonitor != null)
    {
        progressMonitor.afterPageExport();
    }
}
项目:jasperreports    文件:JRPptxExporter.java   
/**
 *
 */
protected void exportPage(JRPrintPage page) throws JRException
{
    frameIndexStack = new ArrayList<Integer>();

    exportElements(page.getElements());

    JRExportProgressMonitor progressMonitor = getCurrentItemConfiguration().getProgressMonitor();
    if (progressMonitor != null)
    {
        progressMonitor.afterPageExport();
    }
}
项目:jasperreports    文件:JRDocxExporter.java   
/**
 *
 */
protected void exportPage(JRPrintPage page) throws JRException
{
    startPage = true;
    pageAnchor = JR_PAGE_ANCHOR_PREFIX + reportIndex + "_" + (pageIndex + 1);

    ReportExportConfiguration configuration = getCurrentItemConfiguration();

    pageGridLayout =
        new JRGridLayout(
            nature,
            page.getElements(),
            pageFormat.getPageWidth(),
            pageFormat.getPageHeight(),
            configuration.getOffsetX() == null ? 0 : configuration.getOffsetX(), 
            configuration.getOffsetY() == null ? 0 : configuration.getOffsetY(),
            null //address
            );

    exportGrid(pageGridLayout, null);

    JRExportProgressMonitor progressMonitor = configuration.getProgressMonitor();
    if (progressMonitor != null)
    {
        progressMonitor.afterPageExport();
    }
}
项目:jasperreports    文件:ReportExportConfiguration.java   
/**
 * Return a {@link net.sf.jasperreports.engine.export.JRExportProgressMonitor JRExportProgressMonitor} instance for monitoring export status. 
 * This is useful for users who need to be notified after each page is exported (a GUI tool that shows a progress bar might need this feature).
 */
@SuppressWarnings("deprecation")
@ExporterParameter(
    type=net.sf.jasperreports.engine.JRExporterParameter.class, 
    name="PROGRESS_MONITOR"
    )
public JRExportProgressMonitor getProgressMonitor();
项目:PDFReporter-Studio    文件:ExportAsOdtAction.java   
@Override
protected JROdtExporter getExporter(JasperReportsConfiguration jContext, JRExportProgressMonitor monitor, File file) {
    JROdtExporter exp = new JROdtExporter(jContext);
    exp.setExporterOutput(new SimpleOutputStreamExporterOutput(file));

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

    return exp;
}
项目:PDFReporter-Studio    文件:ExportAsCsvMetadataAction.java   
@Override
protected JRCsvMetadataExporter getExporter(JasperReportsConfiguration jContext, JRExportProgressMonitor monitor,
        File file) {
    JRCsvMetadataExporter exp = new JRCsvMetadataExporter(jContext);
    exp.setExporterOutput(new SimpleWriterExporterOutput(file));

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

    return exp;
}
项目:PDFReporter-Studio    文件:ExportAsXmlWithImagesAction.java   
@Override
protected JRXmlExporter getExporter(JasperReportsConfiguration jContext, JRExportProgressMonitor monitor, File file) {
    JRXmlExporter exp = new JRXmlExporter(jContext);
    SimpleXmlExporterOutput expOut = new SimpleXmlExporterOutput(file);
    expOut.setEmbeddingImages(Boolean.TRUE);
    exp.setExporterOutput(expOut);

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

    return exp;
}
项目:PDFReporter-Studio    文件:ExportAsXmlAction.java   
@Override
protected JRXmlExporter getExporter(JasperReportsConfiguration jContext, JRExportProgressMonitor monitor, File file) {
    JRXmlExporter exp = new JRXmlExporter(jContext);
    SimpleXmlExporterOutput expOut = new SimpleXmlExporterOutput(file);
    expOut.setEmbeddingImages(Boolean.FALSE);
    exp.setExporterOutput(expOut);

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

    return exp;
}
项目:PDFReporter-Studio    文件:ExportAsTextAction.java   
@Override
protected JRTextExporter getExporter(JasperReportsConfiguration jContext, JRExportProgressMonitor monitor, File file) {
    JRTextExporter exp = new JRTextExporter(jContext);
    exp.setExporterOutput(new SimpleWriterExporterOutput(file));

    exp.setConfiguration(new SimpleTextExporterConfiguration());

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

    return exp;
}
项目:PDFReporter-Studio    文件:AExportXlsAction.java   
@Override
protected JRXlsAbstractExporter<?, ?, ?> getExporter(JasperReportsConfiguration jContext,
        JRExportProgressMonitor monitor, File file) {
    JRXlsAbstractExporter<?, ?, ?> exp = createExporter(jContext, monitor);
    exp.setExporterOutput(new SimpleOutputStreamExporterOutput(file));

    return exp;
}
项目:PDFReporter-Studio    文件:ExportAsXlsxAction.java   
@Override
protected JRXlsxExporter createExporter(JasperReportsConfiguration jContext, JRExportProgressMonitor monitor) {
    JRXlsxExporter exp = new JRXlsxExporter(jContext);

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

    return exp;
}
项目:PDFReporter-Studio    文件:ExportAsXlsAction.java   
@Override
protected JRXlsExporter createExporter(JasperReportsConfiguration jContext, JRExportProgressMonitor monitor) {
    JRXlsExporter exp = new JRXlsExporter(jContext);

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

    return exp;
}
项目:PDFReporter-Studio    文件:ExportAsXlsMetadataAction.java   
@Override
protected JExcelApiMetadataExporter createExporter(JasperReportsConfiguration jContext,
        JRExportProgressMonitor monitor) {
    JExcelApiMetadataExporter exp = new JExcelApiMetadataExporter(jContext);

    SimpleJxlMetadataReportConfiguration rconf = new SimpleJxlMetadataReportConfiguration();
    setupReportConfiguration(rconf, monitor);
    exp.setConfiguration(rconf);
    return exp;
}
项目:PDFReporter-Studio    文件:ExportAsOdsAction.java   
@Override
protected JROdsExporter createExporter(JasperReportsConfiguration jContext, JRExportProgressMonitor monitor) {
    JROdsExporter exp = new JROdsExporter(jContext);

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

    return exp;
}
项目:PDFReporter-Studio    文件:ExportAsExcelAPIAction.java   
@Override
protected JExcelApiExporter createExporter(JasperReportsConfiguration jContext, JRExportProgressMonitor monitor) {
    JExcelApiExporter exp = new JExcelApiExporter(jContext);

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

    return exp;
}
项目:PDFReporter-Studio    文件:ExportAsDocxAction.java   
@Override
protected JRDocxExporter getExporter(JasperReportsConfiguration jContext, JRExportProgressMonitor monitor, File file) {
    JRDocxExporter exp = new JRDocxExporter(jContext);
    exp.setExporterOutput(new SimpleOutputStreamExporterOutput(file));

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

    return exp;
}
项目:PDFReporter-Studio    文件:ExportAsPdfAction.java   
@Override
protected JRPdfExporter getExporter(JasperReportsConfiguration jContext, JRExportProgressMonitor monitor, File file) {
    JRPdfExporter exp = new JRPdfExporter(jContext);

    exp.setExporterOutput(new SimpleOutputStreamExporterOutput(file));

    SimplePdfExporterConfiguration conf = new SimplePdfExporterConfiguration();
    exp.setConfiguration(conf);

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

    return exp;
}
项目:PDFReporter-Studio    文件:AExportAction.java   
protected void setupReportConfiguration(SimpleReportExportConfiguration conf, JRExportProgressMonitor monitor) {
    conf.setProgressMonitor(monitor);

    String indPage = jContext.getProperty(JRExporterPreferencePage.EXPPARAM_INDEX_PAGE, "all"); //$NON-NLS-1$
    Pages p = new Pages().parseString(indPage);

    if (p.getPage() != null)
        conf.setPageIndex(p.getPage());
    else if (p.getFrom() != null) {
        conf.setStartPageIndex(p.getFrom());
        conf.setEndPageIndex(p.getTo());
    }
    conf.setOffsetX(jContext.getPropertyInteger(JRExporterPreferencePage.EXPPARAM_OFFSET_X));
    conf.setOffsetY(jContext.getPropertyInteger(JRExporterPreferencePage.EXPPARAM_OFFSET_Y));
}
项目:PDFReporter-Studio    文件:ExportAsPptxAction.java   
@Override
protected JRPptxExporter getExporter(JasperReportsConfiguration jContext, JRExportProgressMonitor monitor, File file) {
    JRPptxExporter exp = new JRPptxExporter(jContext);
    exp.setExporterOutput(new SimpleOutputStreamExporterOutput(file));

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

    return exp;
}
项目:PDFReporter-Studio    文件:ExportAsCsvAction.java   
@Override
protected JRCsvExporter getExporter(JasperReportsConfiguration jContext, JRExportProgressMonitor monitor, File file) {
    JRCsvExporter exp = new JRCsvExporter(jContext);
    exp.setExporterOutput(new SimpleWriterExporterOutput(file));

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

    return exp;
}
项目: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;
}
项目:PDFReporter-Studio    文件:ExportAsXHtmlAction.java   
@Override
protected JRXhtmlExporter getExporter(JasperReportsConfiguration jContext, JRExportProgressMonitor monitor, File file) {
    JRXhtmlExporter exp = new JRXhtmlExporter(jContext);
    exp.setExporterOutput(new SimpleHtmlExporterOutput(file));

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

    return exp;
}
项目:PDFReporter-Studio    文件:ExportAsLHtmlAction.java   
@Override
protected HtmlExporter getExporter(JasperReportsConfiguration jContext, JRExportProgressMonitor monitor, File file) {
    HtmlExporter exp = new HtmlExporter(jContext);
    exp.setExporterOutput(new SimpleHtmlExporterOutput(file));

    SimpleHtmlReportConfiguration rconf = new SimpleHtmlReportConfiguration();
    setupReportConfiguration(rconf, monitor);
    exp.setConfiguration(rconf);
    return exp;
}
项目:jasperreports    文件:SimpleReportExportConfiguration.java   
@Override
public JRExportProgressMonitor getProgressMonitor()
{
    return progressMonitor;
}
项目:jasperreports    文件:SimpleReportExportConfiguration.java   
/**
 * 
 */
public void setProgressMonitor(JRExportProgressMonitor progressMonitor)
{
    this.progressMonitor = progressMonitor;
}
项目:PDFReporter-Studio    文件:AExportXlsAction.java   
protected abstract JRXlsAbstractExporter<?, ?, ?> createExporter(JasperReportsConfiguration jContext,
JRExportProgressMonitor monitor);
项目:PDFReporter-Studio    文件:AExportAction.java   
protected void exportWithProgress(File file, JRExportProgressMonitor monitor) throws Throwable {
    JRAbstractExporter<?, ?, ?, ?> exporter = getExporter(jContext, monitor, file);
    exporter.setExporterInput(new SimpleExporterInput(getReportViewer().getReport()));

    exporter.exportReport();
}
项目:PDFReporter-Studio    文件:AExportAction.java   
protected abstract JRAbstractExporter<?, ?, ?, ?> getExporter(JasperReportsConfiguration jContext,
JRExportProgressMonitor monitor, File file);
项目:PDFReporter-Studio    文件:ExportAsJasperReportsAction.java   
@Override
protected JRAbstractExporter<?, ?, ?, ?> getExporter(JasperReportsConfiguration jContext,
        JRExportProgressMonitor monitor, File file) {
    return null;
}