org.zkoss.zkex.zul
Class Jasperreport

java.lang.Object
  extended by org.zkoss.zk.ui.AbstractComponent
      extended by org.zkoss.zk.ui.HtmlBasedComponent
          extended by org.zkoss.zul.impl.XulElement
              extended by org.zkoss.zul.Iframe
                  extended by org.zkoss.zkex.zul.Jasperreport
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, HtmlBasedComponent, Component, Scope, ComponentCtrl, Jasperreport, Iframe, XulElement

public class Jasperreport
extends Iframe
implements Jasperreport

The JasperReport component. It is used to generate a Jasper report into an inline frame.

Note: this component is serializable only if the data source (getDatasource()) is serializable.

Since:
3.0.2
Author:
gracelin
See Also:
Serialized Form

Nested Class Summary
protected  class Jasperreport.ExtraCtrl
          A utility class to implement AbstractComponent.getExtraCtrl().
 
Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent
AbstractComponent.Children
 
Field Summary
 
Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
_zclass, RS_NO_DISPLAY, RS_NO_HEIGHT, RS_NO_WIDTH
 
Fields inherited from class org.zkoss.zk.ui.AbstractComponent
_visible
 
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
 
Constructor Summary
Jasperreport()
           
Jasperreport(java.lang.String src)
           
 
Method Summary
 net.sf.jasperreports.engine.JRDataSource getDatasource()
          Returns the JasperReports DataSource.
protected  java.lang.String getEncodedSrc()
          Returns the encoded src (Iframe.getSrc()).
 java.util.Locale getLocale()
          Returns the output file locale.
 java.util.Map getParameters()
          Returns the JasperReports Parameters.
 java.lang.String getSrc()
          Returns the source (jasper file).
 java.lang.String getType()
          Returns the output file type.
 void invalidate()
          Invalidates this component by setting the dirty flag such that it will be redraw the whole content later.
protected  java.lang.Object newExtraCtrl()
          Used by AbstractComponent.getExtraCtrl() to create a client control.
 void setContent(Media media)
          Sets the content directly.
 void setDatasource(net.sf.jasperreports.engine.JRDataSource dataSource)
          Sets the JasperReports DataSource.
 void setLocale(java.util.Locale locale)
          Sets the output file locale.
 void setParameters(java.util.Map parameters)
          Sets the JasperReports Parameters.
 void setSrc(java.lang.String src)
          Sets the source (jasper file).
 void setType(java.lang.String type)
          Sets the output file type.
 
Methods inherited from class org.zkoss.zul.Iframe
getAlign, getContent, getName, getOuterAttrs, getScrolling, isAutohide, isChildable, setAlign, setAutohide, setName, setScrolling
 
Methods inherited from class org.zkoss.zul.impl.XulElement
getAction, getActionAttrs, getAllOnClickAttrs, getContext, getCtrlKeys, getInnerAttrs, getPopup, getTooltip, setAction, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip
 
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
focus, getAllOnClickAttrs, getDraggable, getDroppable, getHeight, getLeft, getMoldSclass, getRealSclass, getRealStyle, getRealStyleFlags, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZclass, getZindex, getZIndex, redraw, setClass, setDraggable, setDroppable, setFocus, setHeight, setLeft, setMoldSclass, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZclass, setZindex, setZIndex
 
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addAnnotation, addEventHandler, addEventListener, addForward, addForward, addForward, addForward, addMoved, addSharedAnnotationMap, addSharedEventHandlerMap, appendAsapAttr, appendAsapAttr, appendChild, applyProperties, clone, containsVariable, detach, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttributes, getAttributes, getChildren, getCommand, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getExtraCtrl, getFellow, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getMoldURI, getNamespace, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getUuid, getVariable, hasFellow, insertBefore, isAsapRequired, isInvalidated, isListenerAvailable, isVisible, newChildren, onChildAdded, onChildRemoved, onDrawNewChild, onPageAttached, onPageDetached, onWrongValue, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, response, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setComponentDefinition, setId, setMold, setPage, setPageBefore, setParent, setVariable, setVisible, smartUpdate, smartUpdate, smartUpdate, smartUpdateDeferred, smartUpdateValues, toString, unsetVariable
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.zkoss.zul.api.Iframe
getAlign, getContent, getName, getScrolling, isAutohide, setAlign, setAutohide, setName, setScrolling
 
Methods inherited from interface org.zkoss.zul.impl.api.XulElement
getAction, getContext, getCtrlKeys, getPopup, getTooltip, setAction, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip
 
Methods inherited from interface org.zkoss.zk.ui.api.HtmlBasedComponent
focus, getHeight, getLeft, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZclass, getZindex, getZIndex, setDraggable, setDroppable, setFocus, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZclass, setZindex, setZIndex
 
Methods inherited from interface org.zkoss.zk.ui.Component
addEventListener, addForward, addForward, addForward, addForward, appendChild, applyProperties, clone, containsVariable, detach, getAttribute, getAttribute, getAttributes, getAttributes, getChildren, getDefinition, getDesktop, getFellow, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNamespace, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getUuid, getVariable, insertBefore, isChildable, isInvalidated, isListenerAvailable, isVisible, redraw, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, setAttribute, setAttribute, setId, setMold, setPage, setPageBefore, setParent, setVariable, setVisible, unsetVariable
 

Constructor Detail

Jasperreport

public Jasperreport()

Jasperreport

public Jasperreport(java.lang.String src)
Method Detail

getSrc

public java.lang.String getSrc()
Returns the source (jasper file).

Specified by:
getSrc in interface Iframe
Overrides:
getSrc in class Iframe
Returns:
src The compiled file (jasper file).

setSrc

public void setSrc(java.lang.String src)
Sets the source (jasper file).

If src is changed, the whole component is invalidate.

Specified by:
setSrc in interface Iframe
Overrides:
setSrc in class Iframe
Parameters:
src - The compiled file (jasper file). If null or empty, nothing is included.
See Also:
Iframe.setContent(org.zkoss.util.media.Media)

setContent

public void setContent(Media media)
Description copied from class: Iframe
Sets the content directly. Default: null.

Calling this method implies setSrc(null). In other words, the last invocation of Iframe.setContent(org.zkoss.util.media.Media) overrides the previous Iframe.setSrc(java.lang.String), if any.

Specified by:
setContent in interface Iframe
Overrides:
setContent in class Iframe
Parameters:
media - the media for this inline frame.
See Also:
Iframe.setSrc(java.lang.String)

getEncodedSrc

protected java.lang.String getEncodedSrc()
Description copied from class: Iframe
Returns the encoded src (Iframe.getSrc()).

Overrides:
getEncodedSrc in class Iframe

getParameters

public java.util.Map getParameters()
Returns the JasperReports Parameters.

Default: null.

Specified by:
getParameters in interface Jasperreport

setParameters

public void setParameters(java.util.Map parameters)
Sets the JasperReports Parameters.

Specified by:
setParameters in interface Jasperreport
Parameters:
parameters - use to fill the report

getDatasource

public net.sf.jasperreports.engine.JRDataSource getDatasource()
Returns the JasperReports DataSource.

Default: null.

Specified by:
getDatasource in interface Jasperreport

setDatasource

public void setDatasource(net.sf.jasperreports.engine.JRDataSource dataSource)
Sets the JasperReports DataSource.

Specified by:
setDatasource in interface Jasperreport
Parameters:
dataSource - use to fill the report

getType

public java.lang.String getType()
Returns the output file type.

Default: pdf.

Specified by:
getType in interface Jasperreport
Since:
3.0.3

setType

public void setType(java.lang.String type)
Sets the output file type. Allowed type: pdf, xml, html, rtf, xls, jxl, csv and odt.
pdf
The PDF format.
rtf
The RTF format (Rich Text Format).
xls
The Microsoft Excel format generated with Apache POI.
jxl
The Microsoft Excel format generated with JExcelApi.
csv
The CSV format (Comma-Separated Values)
odt
The OpenOffice Writer format

Specified by:
setType in interface Jasperreport
Parameters:
type - type of output file. If type is null, assign it a default value "pdf".
Since:
3.0.3

getLocale

public java.util.Locale getLocale()
Returns the output file locale.

Default: null (means the ZK default, Locales.getCurrent())).

getLocale() getParameters() with a value
associated with JRParameter.REPORT_LOCALE
What is used
XignoredX
nullYY
nullnullLocales.getCurrent()

Specified by:
getLocale in interface Jasperreport
Since:
3.0.4

setLocale

public void setLocale(java.util.Locale locale)
Sets the output file locale.

Specified by:
setLocale in interface Jasperreport
Parameters:
locale - the locale. If null, the ZK default is used (Locales.getCurrent()).
Since:
3.0.4
See Also:
getLocale()

invalidate

public void invalidate()
Description copied from interface: Component
Invalidates this component by setting the dirty flag such that it will be redraw the whole content later.

It can be called only in the request-processing and event-processing phases; excluding the redrawing phase.

Specified by:
invalidate in interface Component
Overrides:
invalidate in class AbstractComponent

newExtraCtrl

protected java.lang.Object newExtraCtrl()
Description copied from class: HtmlBasedComponent
Used by AbstractComponent.getExtraCtrl() to create a client control. It is used only by component developers.

Defaut: creates an instance of HtmlBasedComponent.ExtraCtrl.

Overrides:
newExtraCtrl in class Iframe


Copyright © 2005-2009 Potix Corporation. All Rights Reserved.