Java Code Examples for net.sf.jasperreports.engine.export.JRPdfExporter#setParameters()

The following examples show how to use net.sf.jasperreports.engine.export.JRPdfExporter#setParameters() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JasperReportsUtils.java    From lams with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Render a report in PDF 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 renderAsPdf(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));
	JRPdfExporter exporter = new JRPdfExporter();
	exporter.setParameters(exporterParameters);
	render(exporter, print, stream);
}
 
Example 2
Source File: JasperReportsUtils.java    From spring4-understanding with Apache License 2.0 3 votes vote down vote up
/**
 * Render a report in PDF 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 renderAsPdf(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));
	JRPdfExporter exporter = new JRPdfExporter();
	exporter.setParameters(exporterParameters);
	render(exporter, print, stream);
}