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


Java JRPrintXmlLoader类代码示例

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


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

示例1: loadReport

import net.sf.jasperreports.engine.xml.JRPrintXmlLoader; //导入依赖的package包/类
/**
    * @param fileName
    * @param fileName
    * @param isXmlReport
    * @param isXmlReport
    * @throws net.sf.jasperreports.engine.JRException
    * @throws JRException
*/
protected void loadReport(String fileName, boolean isXmlReport) throws JRException
{
	if (isXmlReport)
	{
		jasperPrint = JRPrintXmlLoader.load(fileName);
	}
	else
	{
		jasperPrint = (JasperPrint)JRLoader.loadObjectFromFile(fileName);
	}

	type = TYPE_FILE_NAME;
	this.isXML = isXmlReport;
	reportFileName = fileName;
	btnReload.setEnabled(true);
	setPageIndex(0);
}
 
开发者ID:gnoopy,项目名称:wifepos,代码行数:26,代码来源:JRViewer300.java

示例2: loadJRPrint

import net.sf.jasperreports.engine.xml.JRPrintXmlLoader; //导入依赖的package包/类
protected void loadJRPrint(IEditorInput input) throws PartInitException {
	InputStream in = null;
	try {
		IFile file = null;
		if (input instanceof IFileEditorInput) {
			file = ((IFileEditorInput) input).getFile();
			in = file.getContents();
		} else {
			throw new PartInitException("Invalid Input: Must be IFileEditorInput or FileStoreEditorInput"); //$NON-NLS-1$
		}
		Statistics stats = new Statistics();
		if (file.getFileExtension().equals(".jrpxml")) {
			setJasperPrint(stats, JRPrintXmlLoader.load(in));
		} else {
			Object obj = JRLoader.loadObject(in);
			if (obj instanceof JasperPrint)
				setJasperPrint(stats, (JasperPrint) obj);
		}
	} catch (Exception e) {
		throw new PartInitException("Invalid Input", e);
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:23,代码来源:PreviewJRPrint.java

示例3: loadReport

import net.sf.jasperreports.engine.xml.JRPrintXmlLoader; //导入依赖的package包/类
/**
*/
protected void loadReport(InputStream is, boolean isXmlReport) throws JRException
{
	if (isXmlReport)
	{
		jasperPrint = JRPrintXmlLoader.load(jasperReportsContext, is);
	}
	else
	{
		jasperPrint = (JasperPrint)JRLoader.loadObject(is);
	}
	
	type = TYPE_INPUT_STREAM;
	this.isXML = isXmlReport;
	btnReload.setEnabled(false);
	setPageIndex(0);
}
 
开发者ID:nordpos,项目名称:nordpos,代码行数:19,代码来源:JRViewer.java

示例4: loadReport

import net.sf.jasperreports.engine.xml.JRPrintXmlLoader; //导入依赖的package包/类
/**
*/
protected void loadReport(String fileName, boolean isXmlReport) throws JRException
{
	if (isXmlReport)
	{
		jasperPrint = JRPrintXmlLoader.load(fileName);
	}
	else
	{
		jasperPrint = (JasperPrint)JRLoader.loadObject(fileName);
	}

	type = TYPE_FILE_NAME;
	this.isXML = isXmlReport;
	reportFileName = fileName;
	btnReload.setEnabled(true);
	setPageIndex(0);
}
 
开发者ID:ZarGate,项目名称:OpenbravoPOS,代码行数:20,代码来源:JRViewer300.java

示例5: logExportedFiles

import net.sf.jasperreports.engine.xml.JRPrintXmlLoader; //导入依赖的package包/类
/**
 * @param pdfBytes
 * @param xmlBytes
 * @param pdfName
 * @param xmlName
 * @throws JazzOMRException
 * @throws FileNotFoundException
 * @throws IOException
 */
protected void logExportedFiles(byte[] pdfBytes, byte[] xmlBytes, String pdfName, String xmlName) {
	
	if(!log.isDebugEnabled())
		return;
	
	byte[] pdfFromXML;
	try {
		ByteArrayInputStream bais = new ByteArrayInputStream(xmlBytes);
		JasperPrint jasperPrint = JRPrintXmlLoader.load(bais);
		JRPdfExporter pdfExporter = new JRPdfExporter();
		
		ByteArrayOutputStream baosPDF = new ByteArrayOutputStream();
		pdfExporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
		pdfExporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baosPDF);
		pdfExporter.exportReport();
		
		pdfFromXML = baosPDF.toByteArray();
		
	} catch (JRException e) {
		throw new JazzRuntimeException("erro ao tentar montar relatorio resultado do XML!", e);
	}

	writeToFile(pdfFromXML, "fromXML_"+pdfName);

	writeToFile(pdfBytes, pdfName);

	writeToFile(xmlBytes, xmlName);
}
 
开发者ID:darciopacifico,项目名称:omr,代码行数:38,代码来源:ParticipationHelper.java

示例6: getJasperPrint

import net.sf.jasperreports.engine.xml.JRPrintXmlLoader; //导入依赖的package包/类
private JasperPrint getJasperPrint(String location) throws JRException {
    if (location.contains("jrpxml")) {
        return JRPrintXmlLoader.load(location);
    } else {
        return (JasperPrint) JRLoader.loadObject(location);
    }
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:8,代码来源:JasperReportService.java

示例7: logExportedFiles

import net.sf.jasperreports.engine.xml.JRPrintXmlLoader; //导入依赖的package包/类
/**
 * @param pdfBytes
 * @param xmlBytes
 * @param pdfName
 * @param xmlName
 * @throws JazzOMRException
 * @throws FileNotFoundException
 * @throws IOException
 */
protected void logExportedFiles(byte[] pdfBytes, byte[] xmlBytes, String pdfName, String xmlName) throws JazzOMRException {
	
	
	
	byte[] pdfFromXML;
	try {
		ByteArrayInputStream bais = new ByteArrayInputStream(xmlBytes);
		JasperPrint jasperPrint = JRPrintXmlLoader.load(bais);
		JRPdfExporter pdfExporter = new JRPdfExporter();
		
		ByteArrayOutputStream baosPDF = new ByteArrayOutputStream();
		pdfExporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
		pdfExporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baosPDF);
		pdfExporter.exportReport();
		
		pdfFromXML = baosPDF.toByteArray();
		
	} catch (JRException e) {
		throw new JazzOMRException("erro ao tentar montar relatorio resultado do XML!", e);
	}

	writeToFile(pdfFromXML, "fromXML_"+pdfName);

	writeToFile(pdfBytes, pdfName);

	writeToFile(xmlBytes, xmlName);
}
 
开发者ID:darciopacifico,项目名称:omr,代码行数:37,代码来源:OMRModelTest.java


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