org.opennms.reporting.jasperreports.svclayer
Class JasperReportService

java.lang.Object
  extended by org.opennms.reporting.jasperreports.svclayer.JasperReportService
All Implemented Interfaces:
ReportService

public class JasperReportService
extends Object
implements ReportService

JasperReportService class.

Version:
$Id: $
Author:
ranger

Constructor Summary
JasperReportService()
          Constructor for JasperReportService.
 
Method Summary
 List<ReportFormat> getFormats(String reportId)
          This method provides a list of formats supported by the report
 ReportParameters getParameters(String reportId)
          This method retrieves the runtime parameters taken by the report
 void render(String ReportId, String location, ReportFormat format, OutputStream outputStream)
          This method renders the report into a given output stream.
 String run(HashMap<String,Object> reportParms, String reportId)
          This method runs the report
 void runAndRender(HashMap<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 steps
 void setConfigDao(JasperReportConfigDao jasperReportConfigDao)
          setConfigDao
 boolean validate(HashMap<String,Object> reportParms, String reportId)
          This method validates that the map of report parameters matches the report parameters accepted by the report.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JasperReportService

public JasperReportService()

Constructor for JasperReportService.

Method Detail

getFormats

public List<ReportFormat> getFormats(String reportId)
This method provides a list of formats supported by the report

Specified by:
getFormats in interface ReportService
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 interface ReportService
Parameters:
reportId - a String 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 interface ReportService
Parameters:
ReportId - reportId as defined in database-reports.xml
location - location of the report on disk
format - format to render the report
outputStream - stream to render the resulting report
Throws:
ReportException - if any.

run

public String run(HashMap<String,Object> reportParms,
                  String reportId)
           throws ReportException
This method runs the report

Specified by:
run in interface ReportService
Parameters:
reportParms - hashmap of parameters to be provided at runtime
reportId - reportId as defined in database-reports.xml
Returns:
a String object.
Throws:
ReportException - if any.

runAndRender

public void runAndRender(HashMap<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 interface ReportService
Parameters:
reportParms - a HashMap object.
reportId - reportId as defined in database-reports.xml
format - format to render the report
outputStream - stream to render the resulting report
Throws:
ReportException - if any.

validate

public boolean validate(HashMap<String,Object> reportParms,
                        String reportId)
This method validates that the map of report parameters matches the report parameters accepted by the report. Used by the web interface.

Specified by:
validate in interface ReportService
Parameters:
reportParms - hashmap of parameters to be provided at runtime
reportId - reportId as defined in database-reports.xml
Returns:
true if the reportParms supplied match those in the report definition.

setConfigDao

public void setConfigDao(JasperReportConfigDao jasperReportConfigDao)

setConfigDao

Parameters:
jasperReportConfigDao - a JasperReportConfigDao object.


Copyright © 2011. All Rights Reserved.