Class JasperReports
- java.lang.Object
-
- is.codion.plugin.jasperreports.model.JasperReports
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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(Report<net.sf.jasperreports.engine.JasperReport,net.sf.jasperreports.engine.JasperPrint,Map<String,Object>> 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(Report<net.sf.jasperreports.engine.JasperReport,net.sf.jasperreports.engine.JasperPrint,Map<String,Object>> report, net.sf.jasperreports.engine.JRDataSource dataSource, Map<String,Object> reportParameters)
Fills the report using the given data.static JRReportType
reportType(String name)
-
-
-
Method Detail
-
reportType
public static JRReportType reportType(String name)
- Parameters:
name
- the report name- Returns:
- a JRReport
-
classPathReport
public static JRReport classPathReport(Class<?> resourceClass, String reportPath)
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
public static JRReport fileReport(String reportPath)
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
public static JRReport fileReport(String reportPath, boolean cacheReport)
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(Report<net.sf.jasperreports.engine.JasperReport,net.sf.jasperreports.engine.JasperPrint,Map<String,Object>> report, net.sf.jasperreports.engine.JRDataSource dataSource) throws ReportException
Fills the report using the data source wrapped by the given data wrapper- Parameters:
report
- the reportdataSource
- 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(Report<net.sf.jasperreports.engine.JasperReport,net.sf.jasperreports.engine.JasperPrint,Map<String,Object>> report, net.sf.jasperreports.engine.JRDataSource dataSource, Map<String,Object> reportParameters) throws ReportException
Fills the report using the given data.- Parameters:
report
- the reportdataSource
- the data provider to use for the report generationreportParameters
- the report parameters- Returns:
- a filled report ready for display
- Throws:
ReportException
- in case of an exception
-
-