Class JasperReportBaseAction

    • Field Detail

      • PDF

        public static java.lang.String PDF
      • EXCEL

        public static java.lang.String EXCEL
      • RTF

        public static java.lang.String RTF
      • ODT

        public static java.lang.String ODT
    • Constructor Detail

      • JasperReportBaseAction

        public JasperReportBaseAction()
    • Method Detail

      • getDataSource

        protected abstract net.sf.jasperreports.engine.JRDataSource getDataSource()
                                                                           throws java.lang.Exception
        Data to print.

        If return null then a JDBC connection is sent to JasperReport, this is for the case of a SQL inside JasperReport design.

        Throws:
        java.lang.Exception
      • getJRXML

        protected abstract java.lang.String getJRXML()
                                              throws java.lang.Exception
        The name of the XML with the JasperReports design.

        If it is a relative path (as reports/myreport.jrxml has to be in classpath. If it is a absolute path (as /home/java/reports/myreport.xml or C:\\JAVA\\REPORTS\MYREPORT.JRXML then it look at the file system.

        Throws:
        java.lang.Exception
      • getParameters

        protected abstract java.util.Map getParameters()
                                                throws java.lang.Exception
        Parameters to send to report.
        Throws:
        java.lang.Exception
      • getFormat

        public java.lang.String getFormat()
                                   throws java.lang.Exception
        Output report format, it can be 'pdf' or 'excel'.

        Throws:
        java.lang.Exception
      • setFormat

        public void setFormat​(java.lang.String format)
                       throws java.lang.Exception
        Output report format, it can be 'pdf', 'excel' or 'rtf'.

        Throws:
        java.lang.Exception
      • execute

        public void execute()
                     throws java.lang.Exception
        Specified by:
        execute in interface IAction
        Throws:
        java.lang.Exception
      • getForwardURI

        public java.lang.String getForwardURI()
        Description copied from interface: IForwardAction
        The URI to go.

        If it starts with "http://" or "https://" the action will forward to the absolute URL in internet (since v4m1). Since 7.1 using "javascript:" as prefix to execute JavaScript is not allowed. Since 4.0.1 if it starts with "javascript:" the corresponding code will executed by the browser. Since 5.9 you should use IJavaScriptPostAction to execute JavaScript because IForwardAction with javascript: does not update the page before executing the JavaScript, but executes the JavaScript instead. If it returns null the forwarding is not done.

        Specified by:
        getForwardURI in interface IForwardAction
      • setModel

        public void setModel​(java.lang.String modelName)
        Specified by:
        setModel in interface IModelAction
      • getFileName

        public java.lang.String getFileName()
      • setFileName

        public void setFileName​(java.lang.String fileName)