java.lang.Object
is.codion.plugin.jasperreports.JasperReports
Factory for
Report
based on JasperReports.-
Method Summary
Modifier and TypeMethodDescriptionstatic JRReport
classPathReport
(Class<?> resourceClass, String reportPath) Instantiates a JRReport for a classpath based report.static JRReport
fileReport
(String reportPath) Instantiates a JRReport for a file based report, either loaded from a URL or from the filesystem.static JRReport
fileReport
(String reportPath, boolean cacheReport) Instantiates a JRReport for a file based report, either loaded from a URL or from the filesystem.static net.sf.jasperreports.engine.JasperPrint
fillReport
(JRReport report, net.sf.jasperreports.engine.JRDataSource dataSource) Fills the report using the data source wrapped by the given data wrapperstatic net.sf.jasperreports.engine.JasperPrint
fillReport
(JRReport report, net.sf.jasperreports.engine.JRDataSource dataSource, Map<String, Object> reportParameters) Fills the report using the given data.static JRReportType
reportType
(String name)
-
Method Details
-
reportType
- Parameters:
name
- the report name- Returns:
- a JRReport
-
classPathReport
Instantiates a JRReport for a classpath based report. Note that classpath reports are always cached.- Parameters:
resourceClass
- the class owning the report resourcereportPath
- the report path, relative to the resource class- Returns:
- a report wrapper
-
fileReport
Instantiates a JRReport for a file based report, either loaded from a URL or from the filesystem.- Parameters:
reportPath
- the report path, relative to the central report pathReport.REPORT_PATH
- Returns:
- a report wrapper
-
fileReport
Instantiates a JRReport for a file based report, either loaded from a URL or from the filesystem.- Parameters:
reportPath
- the report path, relative to the central report pathReport.REPORT_PATH
cacheReport
- if true the report is only loaded once and cached- Returns:
- a report wrapper
-
fillReport
public static net.sf.jasperreports.engine.JasperPrint fillReport(JRReport report, net.sf.jasperreports.engine.JRDataSource dataSource) Fills the report using the data source wrapped by the given data wrapper- Parameters:
report
- the report to filldataSource
- the data provider to use for the report generation- Returns:
- a filled report ready for display
- Throws:
ReportException
- in case of an exception
-
fillReport
public static net.sf.jasperreports.engine.JasperPrint fillReport(JRReport report, net.sf.jasperreports.engine.JRDataSource dataSource, Map<String, Object> reportParameters) Fills the report using the given data.- Parameters:
report
- the report to filldataSource
- the data provider to use for the report generationreportParameters
- the report parameters, must be modifiable- Returns:
- a filled report ready for display
- Throws:
ReportException
- in case of an exception
-