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


Java JRLoader類代碼示例

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


JRLoader類屬於net.sf.jasperreports.engine.util包,在下文中一共展示了JRLoader類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: xls

import net.sf.jasperreports.engine.util.JRLoader; //導入依賴的package包/類
/**
 *
 */
public void xls() throws JRException
{
	long start = System.currentTimeMillis();
	File sourceFile = new File("build/reports/XYChart.jrprint");

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

	File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".xls");
	
	JRXlsExporter exporter = new JRXlsExporter();
	
	exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
	exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
	SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
	configuration.setOnePagePerSheet(true);
	exporter.setConfiguration(configuration);
	
	exporter.exportReport();

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

示例2: xls

import net.sf.jasperreports.engine.util.JRLoader; //導入依賴的package包/類
/**
 *
 */
public void xls() throws JRException
{
	long start = System.currentTimeMillis();
	File sourceFile = new File("build/reports/StyledTextReport.jrprint");

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

	File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".xls");
	
	JRXlsExporter exporter = new JRXlsExporter();
	
	exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
	exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
	SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
	configuration.setOnePagePerSheet(false);
	exporter.setConfiguration(configuration);
	
	exporter.exportReport();

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

示例3: docx

import net.sf.jasperreports.engine.util.JRLoader; //導入依賴的package包/類
/**
 *
 */
public void docx() 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"));
	
	JRDocxExporter exporter = new JRDocxExporter();
	
	exporter.setExporterInput(SimpleExporterInput.getInstance(jasperPrintList));
	exporter.setExporterOutput(new SimpleOutputStreamExporterOutput("build/reports/BatchExportReport.docx"));
	
	exporter.exportReport();

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

示例4: xlsx

import net.sf.jasperreports.engine.util.JRLoader; //導入依賴的package包/類
/**
 *
 */
public void xlsx() 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() + ".xlsx");
	
		JRXlsxExporter exporter = new JRXlsxExporter();
	
		exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
		exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
		SimpleXlsxReportConfiguration configuration = new SimpleXlsxReportConfiguration();
		configuration.setOnePagePerSheet(true);
		exporter.setConfiguration(configuration);
	
		exporter.exportReport();

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

示例5: xls

import net.sf.jasperreports.engine.util.JRLoader; //導入依賴的package包/類
/**
 *
 */
public void xls() throws JRException
{
	long start = System.currentTimeMillis();
	File sourceFile = new File("build/reports/StylesReport.jrprint");

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

	File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".xls");
	
	JRXlsExporter exporter = new JRXlsExporter();

	exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
	exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
	SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
	configuration.setOnePagePerSheet(false);
	exporter.setConfiguration(configuration);

	exporter.exportReport();

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

示例6: ods

import net.sf.jasperreports.engine.util.JRLoader; //導入依賴的package包/類
/**
 *
 */
public void ods() 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() + ".ods");

	JROdsExporter exporter = new JROdsExporter();

	exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
	exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
	SimpleOdsReportConfiguration configuration = new SimpleOdsReportConfiguration();
	configuration.setOnePagePerSheet(true);
	exporter.setConfiguration(configuration);

	exporter.exportReport();

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

示例7: fillToFile

import net.sf.jasperreports.engine.util.JRLoader; //導入依賴的package包/類
/**
 * Fills the compiled report design loaded from the file received as the first parameter
 * and places the result in the file specified by the second parameter.
 * 
 * @param sourceFileName source file containing the compile report design
 * @param destFileName   file name to place the generated report into
 * @param params     report parameters map
 * @param dataSource     data source object
 */
public void fillToFile(
	String sourceFileName, 
	String destFileName, 
	Map<String,Object> params,
	JRDataSource dataSource
	) throws JRException
{
	File sourceFile = new File(sourceFileName);

	JasperReport jasperReport = (JasperReport)JRLoader.loadObject(sourceFile);

	JasperReportsContext lcJrCtx = getLocalJasperReportsContext(sourceFile);

	JasperPrint jasperPrint = JRFiller.fill(lcJrCtx, jasperReport, params, dataSource);

	JRSaver.saveObject(jasperPrint, destFileName);
}
 
開發者ID:TIBCOSoftware,項目名稱:jasperreports,代碼行數:27,代碼來源:JasperFillManager.java

示例8: xls

import net.sf.jasperreports.engine.util.JRLoader; //導入依賴的package包/類
/**
 *
 */
public void xls() throws JRException
{
	long start = System.currentTimeMillis();
	File sourceFile = new File("build/reports/XlsFormulaReport.jrprint");

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

	File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".xls");
	
	JRXlsExporter exporter = new JRXlsExporter();
	
	exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
	exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
	SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
	configuration.setOnePagePerSheet(false);
	exporter.setConfiguration(configuration);
	
	exporter.exportReport();

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

示例9: xlsx

import net.sf.jasperreports.engine.util.JRLoader; //導入依賴的package包/類
/**
 *
 */
public void xlsx() throws JRException
{
	long start = System.currentTimeMillis();
	File sourceFile = new File("build/reports/XlsFormulaReport.jrprint");

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

	File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".xlsx");
	
	JRXlsxExporter exporter = new JRXlsxExporter();
	
	exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
	exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
	SimpleXlsxReportConfiguration configuration = new SimpleXlsxReportConfiguration();
	configuration.setOnePagePerSheet(false);
	exporter.setConfiguration(configuration);
	
	exporter.exportReport();

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

示例10: ods

import net.sf.jasperreports.engine.util.JRLoader; //導入依賴的package包/類
/**
 *
 */
public void ods() throws JRException
{
	long start = System.currentTimeMillis();
	File sourceFile = new File("build/reports/StretchReport.jrprint");

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

	File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".ods");
	
	JROdsExporter exporter = new JROdsExporter();
	
	exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
	exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
	SimpleOdsReportConfiguration configuration = new SimpleOdsReportConfiguration();
	configuration.setOnePagePerSheet(true);
	configuration.setFontSizeFixEnabled(true);
	exporter.setConfiguration(configuration);
	
	exporter.exportReport();

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

示例11: xlsx

import net.sf.jasperreports.engine.util.JRLoader; //導入依賴的package包/類
/**
 *
 */
public void xlsx() throws JRException
{
	long start = System.currentTimeMillis();
	File sourceFile = new File("build/reports/MasterReport.jrprint");

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

	File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".xlsx");
	
	JRXlsxExporter exporter = new JRXlsxExporter();
	
	exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
	exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
	SimpleXlsxReportConfiguration configuration = new SimpleXlsxReportConfiguration();
	configuration.setOnePagePerSheet(true);
	exporter.setConfiguration(configuration);
	
	exporter.exportReport();

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

示例12: xls

import net.sf.jasperreports.engine.util.JRLoader; //導入依賴的package包/類
/**
 *
 */
public void xls() throws JRException
{
	long start = System.currentTimeMillis();
	File sourceFile = new File("build/reports/XChartReport.jrprint");

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

	File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".xls");
	
	JRXlsExporter exporter = new JRXlsExporter();
	
	exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
	exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
	SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
	configuration.setOnePagePerSheet(true);
	exporter.setConfiguration(configuration);
	
	exporter.exportReport();

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

示例13: xlsx

import net.sf.jasperreports.engine.util.JRLoader; //導入依賴的package包/類
/**
 *
 */
public void xlsx() throws JRException
{
	long start = System.currentTimeMillis();
	File sourceFile = new File("build/reports/I18nReport.jrprint");

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

	File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".xlsx");
	
	JRXlsxExporter exporter = new JRXlsxExporter();
	
	exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
	exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
	SimpleXlsxReportConfiguration configuration = new SimpleXlsxReportConfiguration();
	configuration.setOnePagePerSheet(false);
	exporter.setConfiguration(configuration);
	
	exporter.exportReport();

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

示例14: ods

import net.sf.jasperreports.engine.util.JRLoader; //導入依賴的package包/類
/**
 *
 */
public void ods() 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() + ".ods");
	
	JROdsExporter exporter = new JROdsExporter();
	
	exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
	exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
	SimpleOdsReportConfiguration configuration = new SimpleOdsReportConfiguration();
	configuration.setOnePagePerSheet(true);
	exporter.setConfiguration(configuration);
	
	exporter.exportReport();

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

示例15: xlsx

import net.sf.jasperreports.engine.util.JRLoader; //導入依賴的package包/類
/**
 *
 */
public void xlsx() throws JRException
{
	long start = System.currentTimeMillis();
	File sourceFile = new File("build/reports/FirstJasper.jrprint");

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

	File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".xlsx");

	Map<String, String> dateFormats = new HashMap<String, String>();
	dateFormats.put("EEE, MMM d, yyyy", "ddd, mmm d, yyyy");

	JRXlsxExporter exporter = new JRXlsxExporter();

	exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
	exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
	SimpleXlsxReportConfiguration configuration = new SimpleXlsxReportConfiguration();
	configuration.setDetectCellType(true);
	configuration.setFormatPatternsMap(dateFormats);
	exporter.setConfiguration(configuration);

	exporter.exportReport();

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


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