當前位置: 首頁>>代碼示例>>Java>>正文


Java SimpleXmlExporterOutput類代碼示例

本文整理匯總了Java中net.sf.jasperreports.export.SimpleXmlExporterOutput的典型用法代碼示例。如果您正苦於以下問題:Java SimpleXmlExporterOutput類的具體用法?Java SimpleXmlExporterOutput怎麽用?Java SimpleXmlExporterOutput使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SimpleXmlExporterOutput類屬於net.sf.jasperreports.export包,在下文中一共展示了SimpleXmlExporterOutput類的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: exportToXmlStream

import net.sf.jasperreports.export.SimpleXmlExporterOutput; //導入依賴的package包/類
/**
 * Exports the generated report object supplied as the first parameter into XML format,
 * and writes the result to the output stream specified by the second parameter.
 * The images are embedded into the XML content itself using the Base64 encoder. 
 * 
 * @param jasperPrint  report object to export
 * @param outputStream output stream to write the resulting XML representation to
 * @see net.sf.jasperreports.engine.export.JRPdfExporter
 */
public void exportToXmlStream(
	JasperPrint jasperPrint, 
	OutputStream outputStream
	) throws JRException
{
	JRXmlExporter exporter = new JRXmlExporter(jasperReportsContext);
	
	exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
	exporter.setExporterOutput(new SimpleXmlExporterOutput(outputStream));
	
	exporter.exportReport();
}
 
開發者ID:TIBCOSoftware,項目名稱:jasperreports,代碼行數:22,代碼來源:JasperExportManager.java

示例6: exportToXml

import net.sf.jasperreports.export.SimpleXmlExporterOutput; //導入依賴的package包/類
/**
 * Exports the generated report object supplied as parameter into XML format
 * and returs the result as String.
 * The images are embedded into the XML content itself using the Base64 encoder. 
 * 
 * @param jasperPrint report object to export
 * @return XML representation of the generated report
 * @see net.sf.jasperreports.engine.export.JRPdfExporter
 */
public String exportToXml(JasperPrint jasperPrint) throws JRException
{
	StringBuilder sb = new StringBuilder();

	JRXmlExporter exporter = new JRXmlExporter(jasperReportsContext);
	
	exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
	exporter.setExporterOutput(new SimpleXmlExporterOutput(sb));
	
	exporter.exportReport();
	
	return sb.toString();
}
 
開發者ID:TIBCOSoftware,項目名稱:jasperreports,代碼行數:23,代碼來源:JasperExportManager.java

示例7: 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

示例8: 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

示例9: 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

示例10: simpleXmlExporterOutput

import net.sf.jasperreports.export.SimpleXmlExporterOutput; //導入依賴的package包/類
private SimpleXmlExporterOutput simpleXmlExporterOutput(JasperIXmlExporter jasperExporter) {
	if (jasperExporter.getOutputWriter() != null) {
		return new SimpleXmlExporterOutput(jasperExporter.getOutputWriter());
	}
	if (jasperExporter.getOutputStream() != null) {
		if (jasperExporter.getCharacterEncoding() != null) {
			return new SimpleXmlExporterOutput(jasperExporter.getOutputStream(), jasperExporter.getCharacterEncoding());
		}
		else {
			return new SimpleXmlExporterOutput(jasperExporter.getOutputStream());
		}
	}
	if (jasperExporter.getOutputFile() != null) {
		if (jasperExporter.getCharacterEncoding() != null) {
			return new SimpleXmlExporterOutput(jasperExporter.getOutputFile(), jasperExporter.getCharacterEncoding());
		}
		else {
			return new SimpleXmlExporterOutput(jasperExporter.getOutputFile());
		}
	}
	if (jasperExporter.getOutputFileName() != null) {
		if (jasperExporter.getCharacterEncoding() != null) {
			return new SimpleXmlExporterOutput(jasperExporter.getOutputFileName(), jasperExporter.getCharacterEncoding());
		}
		else {
			return new SimpleXmlExporterOutput(jasperExporter.getOutputFileName());
		}
	}
	return null;
}
 
開發者ID:svn2github,項目名稱:dynamicreports-jasper,代碼行數:31,代碼來源:ExporterTransform.java

示例11: 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

示例12: xml

import net.sf.jasperreports.export.SimpleXmlExporterOutput; //導入依賴的package包/類
/**
 *
 */
public void xml() throws JRException
{
	long start = System.currentTimeMillis();
	File sourceFile = new File("build/reports/TextReport.jrprint");

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

	File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".jrpxml");
	
	JRXmlExporter exporter = new JRXmlExporter();
	
	exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
	exporter.setExporterOutput(new SimpleXmlExporterOutput(destFile));
	
	exporter.exportReport();

	System.err.println("XML creation time : " + (System.currentTimeMillis() - start));
}
 
開發者ID:TIBCOSoftware,項目名稱:jasperreports,代碼行數:22,代碼來源:TextApp.java


注:本文中的net.sf.jasperreports.export.SimpleXmlExporterOutput類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。