当前位置: 首页>>代码示例>>Java>>正文


Java SimpleXmlExporterOutput.setEmbeddingImages方法代码示例

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


在下文中一共展示了SimpleXmlExporterOutput.setEmbeddingImages方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: exportToXmlFile

import net.sf.jasperreports.export.SimpleXmlExporterOutput; //导入方法依赖的package包/类
/**
 * Exports the generated report object received as parameter into XML format,
 * placing the result into the second file parameter.
 * <p>
 * If not embedded into the XML content itself using the Base64 encoder, 
 * the images are placed as distinct files inside a directory having the same name 
 * as the XML destination file, plus the "_files" suffix. 
 * 
 * @param jasperPrint       report object to export
 * @param destFileName      file name to place the XML representation into
 * @param isEmbeddingImages flag that indicates whether the images should be embedded in the
 *                          XML content itself using the Base64 encoder or be referenced as external resources
 *  
 * @see net.sf.jasperreports.engine.export.JRPdfExporter
 */
public void exportToXmlFile(
	JasperPrint jasperPrint, 
	String destFileName,
	boolean isEmbeddingImages
	) throws JRException
{
	JRXmlExporter exporter = new JRXmlExporter(jasperReportsContext);
	
	exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
	
	SimpleXmlExporterOutput xmlOutput = new SimpleXmlExporterOutput(destFileName);
	xmlOutput.setEmbeddingImages(isEmbeddingImages);
	exporter.setExporterOutput(xmlOutput);
	
	exporter.exportReport();
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:32,代码来源:JasperExportManager.java

示例2: elementToXml

import net.sf.jasperreports.export.SimpleXmlExporterOutput; //导入方法依赖的package包/类
protected String elementToXml(JRPrintElement element)
{
	JRBasePrintPage page = new JRBasePrintPage();
	page.addElement(element);
	JasperPrint jasperPrint = new JasperPrint();
	jasperPrint.addPage(page);
	jasperPrint.setName("test");
	
	StringWriter writer = new StringWriter();
	JRXmlExporter exporter = new JRXmlExporter();
	exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
	SimpleXmlExporterOutput output = new SimpleXmlExporterOutput(writer);
	output.setEmbeddingImages(true);
	exporter.setExporterOutput(output);
	try
	{
		exporter.exportReport();
	}
	catch (JRException e)
	{
		throw new RuntimeException(e);
	}
	return writer.toString();
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:25,代码来源:BaseElementsTests.java

示例3: save

import net.sf.jasperreports.export.SimpleXmlExporterOutput; //导入方法依赖的package包/类
@Override
public void save(JasperPrint jasperPrint, File file) throws JRException
{
	if (
		!file.getName().toLowerCase().endsWith(EXTENSION_XML)
		&& !file.getName().toLowerCase().endsWith(EXTENSION_JRPXML)
		)
	{
		file = new File(file.getAbsolutePath() + EXTENSION_JRPXML);
	}
	
	if (
		!file.exists() ||
		JOptionPane.OK_OPTION == 
			JOptionPane.showConfirmDialog(
				null, 
				MessageFormat.format(
					getBundleString("file.exists"),
					new Object[]{file.getName()}
					), 
				getBundleString("save"), 
				JOptionPane.OK_CANCEL_OPTION
				)
		)
	{
		JRXmlExporter exporter = new JRXmlExporter(getJasperReportsContext());
		exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); 
		SimpleXmlExporterOutput output = new SimpleXmlExporterOutput(file);
		output.setEmbeddingImages(true);
		exporter.setExporterOutput(output);
		exporter.exportReport(); 
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:34,代码来源:JREmbeddedImagesXmlSaveContributor.java

示例4: save

import net.sf.jasperreports.export.SimpleXmlExporterOutput; //导入方法依赖的package包/类
@Override
public void save(JasperPrint jasperPrint, File file) throws JRException
{
	if (
		!file.getName().toLowerCase().endsWith(EXTENSION_XML)
		&& !file.getName().toLowerCase().endsWith(EXTENSION_JRPXML)
		)
	{
		file = new File(file.getAbsolutePath() + EXTENSION_JRPXML);
	}
		
	if (
		!file.exists() ||
		JOptionPane.OK_OPTION == 
			JOptionPane.showConfirmDialog(
				null, 
				MessageFormat.format(
					getBundleString("file.exists"),
					new Object[]{file.getName()}
					), 
				getBundleString("save"), 
				JOptionPane.OK_CANCEL_OPTION
				)
		)
	{
		JRXmlExporter exporter = new JRXmlExporter(getJasperReportsContext());
		exporter.setExporterInput(new SimpleExporterInput(jasperPrint)); 
		SimpleXmlExporterOutput output = new SimpleXmlExporterOutput(file);
		output.setEmbeddingImages(false);
		exporter.setExporterOutput(output);
		exporter.exportReport(); 
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:34,代码来源:JRXmlSaveContributor.java

示例5: xmlExport

import net.sf.jasperreports.export.SimpleXmlExporterOutput; //导入方法依赖的package包/类
protected void xmlExport(JasperPrint print, OutputStream out) throws JRException, IOException
{
	JRXmlExporter exporter = new JRXmlExporter();
	exporter.setExporterInput(new SimpleExporterInput(print));
	SimpleXmlExporterOutput output = new SimpleXmlExporterOutput(out);
	output.setEmbeddingImages(true);
	exporter.setExporterOutput(output);
	exporter.exportReport();
	out.close();
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:11,代码来源:Report.java

示例6: getExporter

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

示例7: getExporter

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

示例8: xml

import net.sf.jasperreports.export.SimpleXmlExporterOutput; //导入方法依赖的package包/类
private JRXmlExporter xml(JasperIXmlExporter jasperExporter) {
	SimpleXmlExporterOutput exporterOutput = simpleXmlExporterOutput(jasperExporter);
	if (jasperExporter.getEmbeddingImages() != null) {
		exporterOutput.setEmbeddingImages(jasperExporter.getEmbeddingImages());
	}
	SimpleReportExportConfiguration reportExportConfiguration = new SimpleReportExportConfiguration();
	reportExportConfiguration(reportExportConfiguration, jasperExporter);
	SimpleExporterConfiguration exporterConfiguration = new SimpleExporterConfiguration();

	JRXmlExporter jrExporter = new JRXmlExporter();
	jrExporter.setExporterOutput(exporterOutput);
	jrExporter.setConfiguration(reportExportConfiguration);
	jrExporter.setConfiguration(exporterConfiguration);
	return jrExporter;
}
 
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:16,代码来源:ExporterTransform.java


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