本文整理汇总了Java中net.sf.jasperreports.engine.export.JRXlsExporter.setExporterInput方法的典型用法代码示例。如果您正苦于以下问题:Java JRXlsExporter.setExporterInput方法的具体用法?Java JRXlsExporter.setExporterInput怎么用?Java JRXlsExporter.setExporterInput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.sf.jasperreports.engine.export.JRXlsExporter
的用法示例。
在下文中一共展示了JRXlsExporter.setExporterInput方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: xls
import net.sf.jasperreports.engine.export.JRXlsExporter; //导入方法依赖的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: xls
import net.sf.jasperreports.engine.export.JRXlsExporter; //导入方法依赖的package包/类
/**
*
*/
public void xls() throws JRException
{
long start = System.currentTimeMillis();
File sourceFile = new File("build/reports/JsonCustomersReport.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));
}
示例3: xls
import net.sf.jasperreports.engine.export.JRXlsExporter; //导入方法依赖的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));
}
示例4: xls
import net.sf.jasperreports.engine.export.JRXlsExporter; //导入方法依赖的package包/类
/**
*
*/
public void xls() throws JRException
{
long start = System.currentTimeMillis();
File sourceFile = new File("build/reports/JFreeChartReport.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));
}
示例5: xls
import net.sf.jasperreports.engine.export.JRXlsExporter; //导入方法依赖的package包/类
/**
*
*/
public void xls() 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() + ".xls");
JRXlsExporter exporter = new JRXlsExporter();
exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(destFile));
SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
configuration.setOnePagePerSheet(true);
configuration.setProgressMonitor(new SimpleExportProgressMonitor());
exporter.setConfiguration(configuration);
exporter.exportReport();
System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
示例6: saveExcelReportToOutputStream
import net.sf.jasperreports.engine.export.JRXlsExporter; //导入方法依赖的package包/类
/**
* Generates an XLS report from a pre-compiled report and returns it into an output stream.
*
* @param jasperPrint
* JasperPrint object which contains a compiled report.
* @param exportParameters
* Export parameters than can be added to configure the resulting report.
* @param outputStream
* The output stream 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 saveExcelReportToOutputStream(JasperPrint jasperPrint,
Map<Object, Object> exportParameters, OutputStream outputStream) throws JRException {
final JRXlsExporter excelExporter = new JRXlsExporter();
SimpleExporterInput exporterInput = new SimpleExporterInput(jasperPrint);
SimpleOutputStreamExporterOutput exporterOutput = new SimpleOutputStreamExporterOutput(
outputStream);
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();
}
示例7: xls
import net.sf.jasperreports.engine.export.JRXlsExporter; //导入方法依赖的package包/类
/**
*
*/
public void xls() 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() + ".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("Report : " + sourceFile + ". XLS creation time : " + (System.currentTimeMillis() - start));
}
}
示例8: xls
import net.sf.jasperreports.engine.export.JRXlsExporter; //导入方法依赖的package包/类
/**
*
*/
public void xls() throws JRException
{
long start = System.currentTimeMillis();
File sourceFile = new File("build/reports/SpiderChart.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));
}
示例9: xls
import net.sf.jasperreports.engine.export.JRXlsExporter; //导入方法依赖的package包/类
/**
*
*/
public void xls() 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"));
JRXlsExporter exporter = new JRXlsExporter();
exporter.setExporterInput(SimpleExporterInput.getInstance(jasperPrintList));
exporter.setExporterOutput(new SimpleOutputStreamExporterOutput("build/reports/BatchExportReport.xls"));
SimpleXlsReportConfiguration configuration = new SimpleXlsReportConfiguration();
configuration.setOnePagePerSheet(false);
exporter.setConfiguration(configuration);
exporter.exportReport();
System.err.println("XLS creation time : " + (System.currentTimeMillis() - start));
}
示例10: xls
import net.sf.jasperreports.engine.export.JRXlsExporter; //导入方法依赖的package包/类
/**
*
*/
public void xls() throws JRException
{
long start = System.currentTimeMillis();
File sourceFile = new File("build/reports/DataSourceReport.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));
}
示例11: xls
import net.sf.jasperreports.engine.export.JRXlsExporter; //导入方法依赖的package包/类
/**
*
*/
public void xls() 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() + ".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));
}
示例12: xls
import net.sf.jasperreports.engine.export.JRXlsExporter; //导入方法依赖的package包/类
/**
*
*/
public void xls() throws JRException
{
long start = System.currentTimeMillis();
File sourceFile = new File("build/reports/MapReport.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));
}
示例13: xls
import net.sf.jasperreports.engine.export.JRXlsExporter; //导入方法依赖的package包/类
/**
*
*/
public void xls() 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() + ".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));
}
示例14: xls
import net.sf.jasperreports.engine.export.JRXlsExporter; //导入方法依赖的package包/类
/**
*
*/
public void xls() throws JRException
{
long start = System.currentTimeMillis();
File sourceFile = new File("build/reports/ImagesReport.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));
}
示例15: xls
import net.sf.jasperreports.engine.export.JRXlsExporter; //导入方法依赖的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));
}