Class JasperReportService

  • All Implemented Interfaces:
    ReportService

    public class JasperReportService
    extends Object
    implements ReportService

    JasperReportService class.

    Version:
    $Id: $
    Author:
    jonathan@opennms.org
    • Constructor Detail

      • JasperReportService

        public 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
      • 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.
      • 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 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.
      • setGlobalReportRepository

        public void setGlobalReportRepository​(GlobalReportRepository globalReportRepository)
      • apply

        protected boolean apply​(List<ParameterFilter> parameterFilters,
                                net.sf.jasperreports.engine.JRParameter reportParm)
      • evaluateToString

        public static String evaluateToString​(net.sf.jasperreports.engine.JasperReport report,
                                              net.sf.jasperreports.engine.JRExpression expression)