Class JasperReportService
- java.lang.Object
-
- org.opennms.reporting.jasperreports.svclayer.JasperReportService
-
- All Implemented Interfaces:
ReportService
public class JasperReportService extends java.lang.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(java.util.List<ParameterFilter> parameterFilters, net.sf.jasperreports.engine.JRParameter reportParm)
static java.lang.String
evaluateToString(net.sf.jasperreports.engine.JasperReport report, net.sf.jasperreports.engine.JRExpression expression)
java.util.List<ReportFormat>
getFormats(java.lang.String reportId)
This method provides a list of formats supported by the reportprotected java.util.List<ParameterFilter>
getParameterFilters()
ReportParameters
getParameters(java.lang.String reportId)
This method retrieves the runtime parameters taken by the reportvoid
render(java.lang.String reportId, java.lang.String location, ReportFormat format, java.io.OutputStream outputStream)
This method renders the report into a given output stream.java.lang.String
run(java.util.Map<java.lang.String,java.lang.Object> reportParms, java.lang.String reportId)
This method runs the reportvoid
runAndRender(java.util.Map<java.lang.String,java.lang.Object> reportParms, java.lang.String reportId, ReportFormat format, java.io.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 java.util.List<ReportFormat> getFormats(java.lang.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(java.lang.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(java.lang.String reportId, java.lang.String location, ReportFormat format, java.io.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 java.lang.String run(java.util.Map<java.lang.String,java.lang.Object> reportParms, java.lang.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(java.util.Map<java.lang.String,java.lang.Object> reportParms, java.lang.String reportId, ReportFormat format, java.io.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(java.util.List<ParameterFilter> parameterFilters, net.sf.jasperreports.engine.JRParameter reportParm)
-
getParameterFilters
protected java.util.List<ParameterFilter> getParameterFilters()
-
evaluateToString
public static java.lang.String evaluateToString(net.sf.jasperreports.engine.JasperReport report, net.sf.jasperreports.engine.JRExpression expression)
-
-