public abstract class JasperReportBaseAction extends ViewBaseAction implements IForwardAction, IModelAction
You only need to overwrite the abstract methods.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
EXCEL |
static java.lang.String |
ODT |
static java.lang.String |
PDF |
static java.lang.String |
RTF |
DETAIL, LIST, PREVIOUS_MODE, SPLIT
Constructor and Description |
---|
JasperReportBaseAction() |
Modifier and Type | Method and Description |
---|---|
void |
execute() |
protected abstract net.sf.jasperreports.engine.JRDataSource |
getDataSource()
Data to print.
|
java.lang.String |
getFileName() |
java.lang.String |
getFormat()
Output report format, it can be 'pdf' or 'excel'.
|
java.lang.String |
getForwardURI()
The URI to go.
|
protected abstract java.lang.String |
getJRXML()
The name of the XML with the JasperReports design.
|
protected abstract java.util.Map |
getParameters()
Parameters to send to report.
|
boolean |
inNewWindow() |
void |
setFileName(java.lang.String fileName) |
void |
setFormat(java.lang.String format)
Output report format, it can be 'pdf', 'excel' or 'rtf'.
|
void |
setModel(java.lang.String modelName) |
closeDialog, getModelName, getPreviousView, getPreviousViews, getView, resetDescriptionsCache, returnToPreviousView, setControllers, setPreviousViews, setView, showDialog, showDialog, showNewView, showView, validateViewValues
addActions, addError, addErrors, addInfo, addMessage, addMessages, addWarning, clearActions, commit, executeAction, executeAfter, executeBefore, getContext, getEnvironment, getErrors, getLocale, getManager, getMessages, getNextMode, getQualifiedActionIfAvailable, getRequest, removeActions, returnToPreviousControllers, rollback, setContext, setDefaultControllers, setEnvironment, setErrors, setMessages, setNextMode, setRequest
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getErrors, getMessages, setEnvironment, setErrors, setMessages
public static java.lang.String PDF
public static java.lang.String EXCEL
public static java.lang.String RTF
public static java.lang.String ODT
protected abstract net.sf.jasperreports.engine.JRDataSource getDataSource() throws java.lang.Exception
If return null then a JDBC connection is sent to JasperReport, this is for the case of a SQL inside JasperReport design.
java.lang.Exception
protected abstract java.lang.String getJRXML() throws java.lang.Exception
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.
java.lang.Exception
protected abstract java.util.Map getParameters() throws java.lang.Exception
java.lang.Exception
public java.lang.String getFormat() throws java.lang.Exception
java.lang.Exception
public void setFormat(java.lang.String format) throws java.lang.Exception
java.lang.Exception
public void execute() throws java.lang.Exception
public java.lang.String getForwardURI()
IForwardAction
If it starts with "http://" or "https://" the action will forward to the absolute URL in internet (since v4m1). 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.
getForwardURI
in interface IForwardAction
public boolean inNewWindow()
inNewWindow
in interface IForwardAction
public void setModel(java.lang.String modelName)
setModel
in interface IModelAction
public java.lang.String getFileName()
public void setFileName(java.lang.String fileName)