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.Iframe
              extended by org.zkoss.zkex.zul.Jasperreport
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, HtmlBasedComponent, Component, Scope, ComponentCtrl, Jasperreport, Iframe

public class Jasperreport
extends Iframe
implements Jasperreport

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

Available in ZK PE and ZK EE.

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
_height, _left, _top, _width, _zclass
 
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
 
Fields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl
CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE
 
Constructor Summary
Jasperreport()
           
Jasperreport(java.lang.String src)
           
 
Method Summary
 java.sql.Connection getDataConnection()
          Returns the JasperReports Data Connection.
 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.
 boolean isHibernate()
          Returns whether enable the hibernate data source.
protected  java.lang.Object newExtraCtrl()
          Used by AbstractComponent.getExtraCtrl() to create a client control.
 void setContent(Media media)
          Sets the content directly.
 void setDataConnection(java.sql.Connection connection)
          Sets the JasperReports Data Connection.
 void setDatasource(net.sf.jasperreports.engine.JRDataSource dataSource)
          Sets the JasperReports DataSource.
 void setHibernate(boolean hibernate)
          Sets whether enable the hibernate data source.
 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, getScrolling, isAutohide, isChildable, renderProperties, service, setAlign, setAutohide, setName, setScrolling
 
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
focus, getDraggable, getDroppable, getHeight, getHflex, getLeft, getSclass, getStyle, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZindex, getZIndex, setClass, setDraggable, setDroppable, setFocus, setHeight, setHflex, setLeft, setSclass, setStyle, setTooltiptext, setTop, setVflex, setWidth, setZclass, setZindex, setZIndex
 
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addAnnotation, addClientEvent, addEventHandler, addEventListener, addForward, addForward, addForward, addForward, addMoved, addScopeListener, addSharedAnnotationMap, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, clone, containsVariable, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableClientUpdate, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getChildren, getClientEvents, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getExtraCtrl, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNamespace, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getUuid, getVariable, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasFellow, hasFellow, insertBefore, invalidate, isInvalidated, isListenerAvailable, isVisible, newChildren, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, onWrongValue, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, removeScopeListener, render, render, render, response, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setVariable, setVisible, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, unsetVariable, updateByClient, willPassivate, willPassivate, willSerialize, willSerialize
 
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.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, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getChildren, getDefinition, getDesktop, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNamespace, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getUuid, getVariable, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttributeOrFellow, hasFellow, hasFellow, insertBefore, invalidate, isInvalidated, isListenerAvailable, isVisible, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, setAttribute, setAttribute, setAuService, setId, setMold, setPage, setPageBefore, setParent, setVariable, setVisible, setWidgetListener, setWidgetOverride, unsetVariable
 
Methods inherited from interface org.zkoss.zk.ui.ext.Scope
addScopeListener, getAttribute, hasAttribute, removeAttribute, removeScopeListener, setAttribute
 

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 redrawn.

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)
Sets the content directly.

Default: null.

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

Specified by:
setContent in interface Iframe
Overrides:
setContent in class Iframe
Parameters:
media - the media to display.
Since:
5.0.0
See Also:
setSrc(java.lang.String)

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

setHibernate

public void setHibernate(boolean hibernate)
Sets whether enable the hibernate data source.

Since:
5.0.1

isHibernate

public boolean isHibernate()
Returns whether enable the hibernate data source.

Default: false

Since:
5.0.1

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

setDataConnection

public void setDataConnection(java.sql.Connection connection)
Sets the JasperReports Data Connection.

Parameters:
connection - use to fill the report
Since:
5.0.1

getDataConnection

public java.sql.Connection getDataConnection()
Returns the JasperReports Data Connection.

Default: null

Since:
5.0.1

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()

getEncodedSrc

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

Overrides:
getEncodedSrc in class Iframe

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. SourceForge.net Logo