本文整理汇总了Java中net.sf.jasperreports.engine.export.JRXlsExporter.setParameters方法的典型用法代码示例。如果您正苦于以下问题:Java JRXlsExporter.setParameters方法的具体用法?Java JRXlsExporter.setParameters怎么用?Java JRXlsExporter.setParameters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.sf.jasperreports.engine.export.JRXlsExporter
的用法示例。
在下文中一共展示了JRXlsExporter.setParameters方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: exportToXLS
import net.sf.jasperreports.engine.export.JRXlsExporter; //导入方法依赖的package包/类
private void exportToXLS() {
log.debug("exporting to XLS");
xlsExporter = new JRXlsExporter();
setExportParameter(JRXlsExporterParameter.IS_DETECT_CELL_TYPE,
Boolean.TRUE);
setExportParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET,
Boolean.FALSE);
xlsExporter.setParameters(getExportParameters());
try {
start = System.currentTimeMillis();
xlsExporter.exportReport();
log.info("export running time (msec): "
+ (System.currentTimeMillis() - start));
} catch (JRException jre) {
jre.printStackTrace();
log.error(jre.getMessage());
}
}
示例2: renderAsXls
import net.sf.jasperreports.engine.export.JRXlsExporter; //导入方法依赖的package包/类
/**
* Render a report in XLS format using the supplied report data.
* Writes the results to the supplied {@code OutputStream}.
* @param report the {@code JasperReport} instance to render
* @param parameters the parameters to use for rendering
* @param stream the {@code OutputStream} to write the rendered report to
* @param reportData a {@code JRDataSource}, {@code java.util.Collection} or object array
* (converted accordingly), representing the report data to read fields from
* @param exporterParameters a {@link Map} of {@link JRExporterParameter exporter parameters}
* @throws JRException if rendering failed
* @see #convertReportData
*/
public static void renderAsXls(JasperReport report, Map<String, Object> parameters, Object reportData,
OutputStream stream, Map<JRExporterParameter, Object> exporterParameters) throws JRException {
JasperPrint print = JasperFillManager.fillReport(report, parameters, convertReportData(reportData));
JRXlsExporter exporter = new JRXlsExporter();
exporter.setParameters(exporterParameters);
render(exporter, print, stream);
}
示例3: renderAsXls
import net.sf.jasperreports.engine.export.JRXlsExporter; //导入方法依赖的package包/类
/**
* Render a report in XLS format using the supplied report data.
* Writes the results to the supplied {@code OutputStream}.
* @param report the {@code JasperReport} instance to render
* @param parameters the parameters to use for rendering
* @param stream the {@code OutputStream} to write the rendered report to
* @param reportData a {@code JRDataSource}, {@code java.util.Collection} or object array
* (converted accordingly), representing the report data to read fields from
* @param exporterParameters a {@link Map} of {@code JRExporterParameter exporter parameters}
* @throws JRException if rendering failed
* @see #convertReportData
*/
public static void renderAsXls(JasperReport report, Map<String, Object> parameters, Object reportData,
OutputStream stream, Map<net.sf.jasperreports.engine.JRExporterParameter, Object> exporterParameters)
throws JRException {
JasperPrint print = JasperFillManager.fillReport(report, parameters, convertReportData(reportData));
JRXlsExporter exporter = new JRXlsExporter();
exporter.setParameters(exporterParameters);
render(exporter, print, stream);
}