• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java JRRtfExporter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中net.sf.jasperreports.engine.export.JRRtfExporter的典型用法代码示例。如果您正苦于以下问题:Java JRRtfExporter类的具体用法?Java JRRtfExporter怎么用?Java JRRtfExporter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



JRRtfExporter类属于net.sf.jasperreports.engine.export包,在下文中一共展示了JRRtfExporter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: export

import net.sf.jasperreports.engine.export.JRRtfExporter; //导入依赖的package包/类
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();
		}
	}
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:23,代码来源:RtfExporter.java


示例2: rtf

import net.sf.jasperreports.engine.export.JRRtfExporter; //导入依赖的package包/类
/**
 *
 */
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));
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:26,代码来源:ListApp.java


示例3: rtf

import net.sf.jasperreports.engine.export.JRRtfExporter; //导入依赖的package包/类
/**
 *
 */
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));
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:26,代码来源:CsvDataSourceApp.java


示例4: rtf

import net.sf.jasperreports.engine.export.JRRtfExporter; //导入依赖的package包/类
/**
 *
 */
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));
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:25,代码来源:ScriptletApp.java


示例5: rtf

import net.sf.jasperreports.engine.export.JRRtfExporter; //导入依赖的package包/类
/**
 *
 */
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));
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:21,代码来源:BatchExportApp.java


示例6: exportElement

import net.sf.jasperreports.engine.export.JRRtfExporter; //导入依赖的package包/类
@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);
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:17,代码来源:MapElementRtfHandler.java


示例7: createExporter

import net.sf.jasperreports.engine.export.JRRtfExporter; //导入依赖的package包/类
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;
    }
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:23,代码来源:ReportCreateTaskHandler.java


示例8: getRtf

import net.sf.jasperreports.engine.export.JRRtfExporter; //导入依赖的package包/类
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;
}
 
开发者ID:nextreports,项目名称:nextreports-server,代码行数:20,代码来源:JasperReportsUtil.java


示例9: save

import net.sf.jasperreports.engine.export.JRRtfExporter; //导入依赖的package包/类
@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();
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:29,代码来源:JRRtfSaveContributor.java


示例10: exportRtf

import net.sf.jasperreports.engine.export.JRRtfExporter; //导入依赖的package包/类
public void exportRtf() throws JRException {
	JRRtfExporter exporter = new JRRtfExporter();
	exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
	exporter.setExporterOutput(new SimpleWriterExporterOutput(this.output
			.getAbsolutePath() + ".rtf"));
	exporter.exportReport();
}
 
开发者ID:vosskaem,项目名称:jasperstarter,代码行数:8,代码来源:Report.java


示例11: getExporter

import net.sf.jasperreports.engine.export.JRRtfExporter; //导入依赖的package包/类
@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;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:12,代码来源:ExportAsRtfAction.java


示例12: export

import net.sf.jasperreports.engine.export.JRRtfExporter; //导入依赖的package包/类
/**
 * 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.");
    }
}
 
开发者ID:seedstack,项目名称:io-addon,代码行数:43,代码来源:JasperRenderer.java


示例13: rtf

import net.sf.jasperreports.engine.export.JRRtfExporter; //导入依赖的package包/类
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();
 }
 
开发者ID:stefanorosanelli,项目名称:jasper-service,代码行数:8,代码来源:JasperProcess.java


示例14: exportToRTF

import net.sf.jasperreports.engine.export.JRRtfExporter; //导入依赖的package包/类
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());
    }
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:15,代码来源:OOReportGenerator.java


示例15: rtf

import net.sf.jasperreports.engine.export.JRRtfExporter; //导入依赖的package包/类
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;
}
 
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:16,代码来源:ExporterTransform.java


示例16: exportElement

import net.sf.jasperreports.engine.export.JRRtfExporter; //导入依赖的package包/类
@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);
  }
}
 
开发者ID:sourcepole,项目名称:jasperreports-wms-component,代码行数:13,代码来源:WmsMapElementRtfHandler.java


示例17: rtf

import net.sf.jasperreports.engine.export.JRRtfExporter; //导入依赖的package包/类
/**
 *
 */
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));
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:22,代码来源:UnicodeApp.java


示例18: rtf

import net.sf.jasperreports.engine.export.JRRtfExporter; //导入依赖的package包/类
/**
 *
 */
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));
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:22,代码来源:BookApp.java


示例19: rtf

import net.sf.jasperreports.engine.export.JRRtfExporter; //导入依赖的package包/类
/**
 *
 */
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));
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:22,代码来源:Barcode4JApp.java


示例20: rtf

import net.sf.jasperreports.engine.export.JRRtfExporter; //导入依赖的package包/类
/**
 *
 */
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));
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:22,代码来源:DataSourceApp.java



注:本文中的net.sf.jasperreports.engine.export.JRRtfExporter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java HostApduService类代码示例发布时间:2022-05-21
下一篇:
Java MockSyncService类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap