本文整理匯總了Java中net.sf.jasperreports.engine.util.JRLoader.loadObject方法的典型用法代碼示例。如果您正苦於以下問題:Java JRLoader.loadObject方法的具體用法?Java JRLoader.loadObject怎麽用?Java JRLoader.loadObject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.sf.jasperreports.engine.util.JRLoader
的用法示例。
在下文中一共展示了JRLoader.loadObject方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: ods
import net.sf.jasperreports.engine.util.JRLoader; //導入方法依賴的package包/類
/**
*
*/
public void ods() 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() + ".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));
}
示例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/TableReport.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));
}
示例3: csv
import net.sf.jasperreports.engine.util.JRLoader; //導入方法依賴的package包/類
/**
*
*/
public void csv() throws JRException
{
long start = System.currentTimeMillis();
File sourceFile = new File("build/reports/CustomersReport.jrprint");
JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile);
File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".csv");
JRCsvExporter exporter = new JRCsvExporter();
exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
exporter.setExporterOutput(new SimpleWriterExporterOutput(destFile));
//exporter.setParameter(JRCsvExporterParameter.FIELD_DELIMITER, "|");
exporter.exportReport();
System.err.println("CSV creation time : " + (System.currentTimeMillis() - start));
}
示例4: ods
import net.sf.jasperreports.engine.util.JRLoader; //導入方法依賴的package包/類
/**
*
*/
public void ods() throws JRException
{
long start = System.currentTimeMillis();
File sourceFile = new File("build/reports/HyperlinkReport.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));
}
示例5: xlsx
import net.sf.jasperreports.engine.util.JRLoader; //導入方法依賴的package包/類
/**
*
*/
public void xlsx() throws JRException
{
long start = System.currentTimeMillis();
File sourceFile = new File("build/reports/NoReport.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));
}
示例6: text
import net.sf.jasperreports.engine.util.JRLoader; //導入方法依賴的package包/類
/**
*
*/
public void text() throws JRException
{
long start = System.currentTimeMillis();
JRTextExporter exporter = new JRTextExporter();
File sourceFile = new File("build/reports/TextReport.jrprint");
JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile);
File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".txt");
exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
exporter.setExporterOutput(new SimpleWriterExporterOutput(destFile));
exporter.exportReport();
System.err.println("Text creation time : " + (System.currentTimeMillis() - start));
}
示例7: fillToStream
import net.sf.jasperreports.engine.util.JRLoader; //導入方法依賴的package包/類
/**
* Fills the compiled report design loaded from the supplied input stream and writes
* the generated report object to the output stream specified by the second parameter.
*
* @param inputStream input stream to read the compiled report design object from
* @param outputStream output stream to write the generated report object to
* @param parameters report parameters map
* @param connection JDBC connection object to use for executing the report internal SQL query
*/
public void fillToStream(
InputStream inputStream,
OutputStream outputStream,
Map<String,Object> parameters,
Connection connection
) throws JRException
{
JasperReport jasperReport = (JasperReport)JRLoader.loadObject(inputStream);
fillToStream(jasperReport, outputStream, parameters, connection);
}
示例8: print
import net.sf.jasperreports.engine.util.JRLoader; //導入方法依賴的package包/類
/**
*
*/
public boolean print(
InputStream inputStream,
boolean withPrintDialog
) throws JRException
{
JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(inputStream);
return print(jasperPrint, withPrintDialog);
}
示例9: pptx
import net.sf.jasperreports.engine.util.JRLoader; //導入方法依賴的package包/類
/**
*
*/
public void pptx() 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() + ".pptx");
JRPptxExporter exporter = new JRPptxExporter();
exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
exporter.exportReport();
System.err.println("PPTX creation time : " + (System.currentTimeMillis() - start));
}
示例10: rtf
import net.sf.jasperreports.engine.util.JRLoader; //導入方法依賴的package包/類
/**
*
*/
public void rtf() throws JRException
{
long start = System.currentTimeMillis();
File sourceFile = new File("build/reports/XlsxDataSourceReport.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));
}
示例11: rtf
import net.sf.jasperreports.engine.util.JRLoader; //導入方法依賴的package包/類
/**
*
*/
public void rtf() 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() + ".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));
}
示例12: csv
import net.sf.jasperreports.engine.util.JRLoader; //導入方法依賴的package包/類
/**
*
*/
public void csv() throws JRException
{
long start = System.currentTimeMillis();
File sourceFile = new File("build/reports/JRMDbReport.jrprint");
JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile);
File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".csv");
JRCsvExporter exporter = new JRCsvExporter();
exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
exporter.setExporterOutput(new SimpleWriterExporterOutput(destFile));
exporter.exportReport();
System.err.println("CSV creation time : " + (System.currentTimeMillis() - start));
}
示例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/StyledTextReport.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));
exporter.exportReport();
System.err.println("XLSX creation time : " + (System.currentTimeMillis() - start));
}
示例14: docx
import net.sf.jasperreports.engine.util.JRLoader; //導入方法依賴的package包/類
/**
*
*/
public void docx() throws JRException
{
long start = System.currentTimeMillis();
File sourceFile = new File("build/reports/HtmlComponentReport.jrprint");
JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile);
File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".docx");
JRDocxExporter exporter = new JRDocxExporter();
exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
exporter.exportReport();
System.err.println("DOCX creation time : " + (System.currentTimeMillis() - start));
}
示例15: odt
import net.sf.jasperreports.engine.util.JRLoader; //導入方法依賴的package包/類
/**
*
*/
public void odt() throws JRException
{
long start = System.currentTimeMillis();
File sourceFile = new File("build/reports/MarkupReport.jrprint");
JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile);
File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".odt");
JROdtExporter exporter = new JROdtExporter();
exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
exporter.exportReport();
System.err.println("ODT creation time : " + (System.currentTimeMillis() - start));
}