本文整理汇总了Java中net.sf.jasperreports.export.SimpleOutputStreamExporterOutput类的典型用法代码示例。如果您正苦于以下问题:Java SimpleOutputStreamExporterOutput类的具体用法?Java SimpleOutputStreamExporterOutput怎么用?Java SimpleOutputStreamExporterOutput使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SimpleOutputStreamExporterOutput类属于net.sf.jasperreports.export包,在下文中一共展示了SimpleOutputStreamExporterOutput类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: xls
import net.sf.jasperreports.export.SimpleOutputStreamExporterOutput; //导入依赖的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));
}
示例2: pdf
import net.sf.jasperreports.export.SimpleOutputStreamExporterOutput; //导入依赖的package包/类
/**
*
*/
public void pdf() 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"));
JRPdfExporter exporter = new JRPdfExporter();
exporter.setExporterInput(SimpleExporterInput.getInstance(jasperPrintList));
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput("build/reports/BatchExportReport.pdf"));
SimplePdfExporterConfiguration configuration = new SimplePdfExporterConfiguration();
configuration.setCreatingBatchModeBookmarks(true);
exporter.setConfiguration(configuration);
exporter.exportReport();
System.err.println("PDF creation time : " + (System.currentTimeMillis() - start));
}
示例3: ods
import net.sf.jasperreports.export.SimpleOutputStreamExporterOutput; //导入依赖的package包/类
/**
*
*/
public void ods() 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() + ".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("Report : " + sourceFile + ". ODS creation time : " + (System.currentTimeMillis() - start));
}
}
示例4: saveExcelReportToFile
import net.sf.jasperreports.export.SimpleOutputStreamExporterOutput; //导入依赖的package包/类
/**
* Generates an XLS report from a pre-compiled report and returns it into a file.
*
* @param jasperPrint
* JasperPrint object which contains a compiled report.
* @param exportParameters
* Export parameters than can be added to configure the resulting report.
* @param file
* The file used to return the report.
* @throws JRException
* In case there is any error generating the report an exception is thrown with the
* error message.
*/
private static void saveExcelReportToFile(JasperPrint jasperPrint,
Map<Object, Object> exportParameters, File file) throws JRException {
final JRXlsExporter excelExporter = new JRXlsExporter();
SimpleExporterInput exporterInput = new SimpleExporterInput(jasperPrint);
SimpleOutputStreamExporterOutput exporterOutput = new SimpleOutputStreamExporterOutput(file);
if (exportParameters != null && exportParameters.size() > 0) {
SimpleXlsReportConfiguration exportConfiguration = getXlsConfigurationFromExportParameters(exportParameters);
excelExporter.setConfiguration(exportConfiguration);
} else {
SimpleXlsReportConfiguration reportExportConfiguration = new SimpleXlsReportConfiguration();
reportExportConfiguration.setOnePagePerSheet(false);
reportExportConfiguration.setRemoveEmptySpaceBetweenRows(true);
excelExporter.setConfiguration(reportExportConfiguration);
}
excelExporter.setExporterInput(exporterInput);
excelExporter.setExporterOutput(exporterOutput);
excelExporter.exportReport();
}
示例5: xlsx
import net.sf.jasperreports.export.SimpleOutputStreamExporterOutput; //导入依赖的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));
}
}
示例6: ods
import net.sf.jasperreports.export.SimpleOutputStreamExporterOutput; //导入依赖的package包/类
/**
*
*/
public void ods() throws JRException
{
long start = System.currentTimeMillis();
File sourceFile = new File("build/reports/BarbecueReport.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));
}
示例7: odt
import net.sf.jasperreports.export.SimpleOutputStreamExporterOutput; //导入依赖的package包/类
/**
*
*/
public void odt() 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() + ".odt");
JROdtExporter exporter = new JROdtExporter();
exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
exporter.exportReport();
System.err.println("Report : " + sourceFile + ". ODT creation time : " + (System.currentTimeMillis() - start));
}
}
示例8: docx
import net.sf.jasperreports.export.SimpleOutputStreamExporterOutput; //导入依赖的package包/类
/**
*
*/
public void docx() 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() + ".docx");
JRDocxExporter exporter = new JRDocxExporter();
exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
exporter.exportReport();
System.err.println("Report : " + sourceFile + ". DOCX creation time : " + (System.currentTimeMillis() - start));
}
}
示例9: ods
import net.sf.jasperreports.export.SimpleOutputStreamExporterOutput; //导入依赖的package包/类
/**
*
*/
public void ods() throws JRException
{
long start = System.currentTimeMillis();
File sourceFile = new File("build/reports/BookReport.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));
}
示例10: xlsx
import net.sf.jasperreports.export.SimpleOutputStreamExporterOutput; //导入依赖的package包/类
/**
*
*/
public void xlsx() throws JRException
{
long start = System.currentTimeMillis();
File sourceFile = new File("build/reports/BookReport.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));
}
示例11: ods
import net.sf.jasperreports.export.SimpleOutputStreamExporterOutput; //导入依赖的package包/类
/**
*
*/
public void ods() throws JRException
{
long start = System.currentTimeMillis();
File sourceFile = new File("build/reports/XlsDataSourceReport.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));
}
示例12: ods
import net.sf.jasperreports.export.SimpleOutputStreamExporterOutput; //导入依赖的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));
}
示例13: xlsx
import net.sf.jasperreports.export.SimpleOutputStreamExporterOutput; //导入依赖的package包/类
/**
*
*/
public void xlsx() 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() + ".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));
}
示例14: ods
import net.sf.jasperreports.export.SimpleOutputStreamExporterOutput; //导入依赖的package包/类
/**
*
*/
public void ods() throws JRException
{
long start = System.currentTimeMillis();
File sourceFile = new File("build/reports/ScriptletReport.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.setProgressMonitor(new SimpleExportProgressMonitor());
exporter.setConfiguration(configuration);
exporter.exportReport();
System.err.println("ODS creation time : " + (System.currentTimeMillis() - start));
}
示例15: ods
import net.sf.jasperreports.export.SimpleOutputStreamExporterOutput; //导入依赖的package包/类
/**
*
*/
public void ods() 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() + ".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));
}