Class JasperReportBaseAction
- java.lang.Object
-
- org.openxava.actions.BaseAction
-
- org.openxava.actions.ViewBaseAction
-
- org.openxava.actions.JasperReportBaseAction
-
- All Implemented Interfaces:
IAction,IChangeModeAction,IForwardAction,IModelAction,IModuleContextAction,IRequestAction
public abstract class JasperReportBaseAction extends ViewBaseAction implements IForwardAction, IModelAction
To generate your custom Jasper Report.You only need to overwrite the abstract methods.
- Author:
- Javier Paniza, Daniel GarcĂa Salas
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringEXCELstatic java.lang.StringODTstatic java.lang.StringPDFstatic java.lang.StringRTF-
Fields inherited from interface org.openxava.actions.IChangeModeAction
DETAIL, LIST, PREVIOUS_MODE, SPLIT
-
-
Constructor Summary
Constructors Constructor Description JasperReportBaseAction()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidexecute()protected abstract net.sf.jasperreports.engine.JRDataSourcegetDataSource()Data to print.java.lang.StringgetFileName()java.lang.StringgetFormat()Output report format, it can be 'pdf' or 'excel'.java.lang.StringgetForwardURI()The URI to go.protected abstract java.lang.StringgetJRXML()The name of the XML with the JasperReports design.protected abstract java.util.MapgetParameters()Parameters to send to report.booleaninNewWindow()voidsetFileName(java.lang.String fileName)voidsetFormat(java.lang.String format)Output report format, it can be 'pdf', 'excel' or 'rtf'.voidsetModel(java.lang.String modelName)-
Methods inherited from class org.openxava.actions.ViewBaseAction
changeThisPropertyByViewValue, closeDialog, getModelName, getPreviousView, getPreviousViews, getView, resetDescriptionsCache, returnToPreviousView, setControllers, setPreviousViews, setView, showDialog, showDialog, showNewView, showView, validateViewValues
-
Methods inherited from class org.openxava.actions.BaseAction
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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openxava.actions.IAction
getErrors, getMessages, setEnvironment, setErrors, setMessages
-
-
-
-
Method Detail
-
getDataSource
protected abstract net.sf.jasperreports.engine.JRDataSource getDataSource() throws java.lang.ExceptionData 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.ExceptionThe name of the XML with the JasperReports design.If it is a relative path (as
reports/myreport.jrxmlhas to be in classpath. If it is a absolute path (as/home/java/reports/myreport.xmlorC:\\JAVA\\REPORTS\MYREPORT.JRXMLthen it look at the file system.- Throws:
java.lang.Exception
-
getParameters
protected abstract java.util.Map getParameters() throws java.lang.ExceptionParameters to send to report.- Throws:
java.lang.Exception
-
getFormat
public java.lang.String getFormat() throws java.lang.ExceptionOutput report format, it can be 'pdf' or 'excel'.- Throws:
java.lang.Exception
-
setFormat
public void setFormat(java.lang.String format) throws java.lang.ExceptionOutput report format, it can be 'pdf', 'excel' or 'rtf'.- Throws:
java.lang.Exception
-
execute
public void execute() throws java.lang.Exception
-
getForwardURI
public java.lang.String getForwardURI()
Description copied from interface:IForwardActionThe 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:
getForwardURIin interfaceIForwardAction
-
inNewWindow
public boolean inNewWindow()
- Specified by:
inNewWindowin interfaceIForwardAction
-
setModel
public void setModel(java.lang.String modelName)
- Specified by:
setModelin interfaceIModelAction
-
getFileName
public java.lang.String getFileName()
-
setFileName
public void setFileName(java.lang.String fileName)
-
-