Class JasperReportService
- java.lang.Object
-
- org.opennms.reporting.jasperreports.svclayer.JasperReportService
-
- All Implemented Interfaces:
ReportService
public class JasperReportService extends Object implements ReportService
JasperReportService class.
- Version:
- $Id: $
- Author:
- jonathan@opennms.org
-
-
Constructor Summary
Constructors Constructor Description JasperReportService()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
apply(List<ParameterFilter> parameterFilters, net.sf.jasperreports.engine.JRParameter reportParm)
static String
evaluateToString(net.sf.jasperreports.engine.JasperReport report, net.sf.jasperreports.engine.JRExpression expression)
List<ReportFormat>
getFormats(String reportId)
This method provides a list of formats supported by the reportprotected List<ParameterFilter>
getParameterFilters()
ReportParameters
getParameters(String reportId)
This method retrieves the runtime parameters taken by the reportvoid
render(String reportId, String location, ReportFormat format, OutputStream outputStream)
This method renders the report into a given output stream.String
run(Map<String,Object> reportParms, String reportId)
This method runs the reportvoid
runAndRender(Map<String,Object> reportParms, String reportId, ReportFormat format, OutputStream outputStream)
This method runs the report and renders in into the given output stream with no intermediate stepsvoid
setGlobalReportRepository(GlobalReportRepository globalReportRepository)
-
-
-
Method Detail
-
getFormats
public List<ReportFormat> getFormats(String reportId)
This method provides a list of formats supported by the report- Specified by:
getFormats
in interfaceReportService
- Parameters:
reportId
- reportId as defined in database-reports.xml- Returns:
- a list of supported formats
-
getParameters
public ReportParameters getParameters(String reportId) throws ReportException
This method retrieves the runtime parameters taken by the report- Specified by:
getParameters
in interfaceReportService
- Parameters:
reportId
- aString
object.- Returns:
- a ReportParameters object containing the parameters taken by the report
- Throws:
ReportException
-
render
public void render(String reportId, String location, ReportFormat format, OutputStream outputStream) throws ReportException
This method renders the report into a given output stream.- Specified by:
render
in interfaceReportService
- Parameters:
reportId
- reportId as defined in database-reports.xmllocation
- location of the report on diskformat
- format to render the reportoutputStream
- stream to render the resulting report- Throws:
ReportException
- if any.
-
run
public String run(Map<String,Object> reportParms, String reportId) throws ReportException
This method runs the report- Specified by:
run
in interfaceReportService
- Parameters:
reportParms
- hashmap of parameters to be provided at runtimereportId
- reportId as defined in database-reports.xml- Returns:
- a
String
object. - Throws:
ReportException
- if any.
-
runAndRender
public void runAndRender(Map<String,Object> reportParms, String reportId, ReportFormat format, OutputStream outputStream) throws ReportException
This method runs the report and renders in into the given output stream with no intermediate steps- Specified by:
runAndRender
in interfaceReportService
- Parameters:
reportParms
- aHashMap
object.reportId
- reportId as defined in database-reports.xmlformat
- format to render the reportoutputStream
- stream to render the resulting report- Throws:
ReportException
- if any.
-
setGlobalReportRepository
public void setGlobalReportRepository(GlobalReportRepository globalReportRepository)
-
apply
protected boolean apply(List<ParameterFilter> parameterFilters, net.sf.jasperreports.engine.JRParameter reportParm)
-
getParameterFilters
protected List<ParameterFilter> getParameterFilters()
-
evaluateToString
public static String evaluateToString(net.sf.jasperreports.engine.JasperReport report, net.sf.jasperreports.engine.JRExpression expression)
-
-