public class Jasperreport extends Iframe
Available in ZK PE and ZK EE.
Note: this component is serializable only if the data source (getDatasource()
)
is serializable.
Modifier and Type | Class and Description |
---|---|
protected class |
Jasperreport.ExtraCtrl
A utility class to implement
HtmlBasedComponent.getExtraCtrl() . |
class |
Jasperreport.JasperreporteExporterImpl |
AbstractComponent.Children
_zclass
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
AFTER_CHILD_ADDED, AFTER_CHILD_REMOVED, AFTER_PAGE_ATTACHED, AFTER_PAGE_DETACHED, CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE
Constructor and Description |
---|
Jasperreport() |
Jasperreport(java.lang.String src) |
Modifier and Type | Method and Description |
---|---|
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.lang.String |
getExportName()
Returns the export file name for the download if any,
the full name will be exportName + "." + format.
|
java.lang.Object |
getExtraCtrl()
Returns the client control for this component.
|
JasperreportExporterFactory |
getJasperreporteExporterFactory() |
java.util.Locale |
getLocale()
Returns the output file locale.
|
java.util.Map<java.lang.String,java.lang.Object> |
getParameters()
Returns the JasperReports Parameters.
|
Media |
getReport()
Returns a AMedia contains report's byte stream.
|
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 of this
component and its dependencies later.
|
boolean |
isHibernate()
Returns whether enable the hibernate data source.
|
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 |
setExportName(java.lang.String exportName)
Sets the export file name for the download if any,
the full name will be exportName + "." + format.
|
void |
setHibernate(boolean hibernate)
Sets whether enable the hibernate data source.
|
void |
setJasperreporteExporterFactory(JasperreportExporterFactory factory)
Set the factory to use your own exporter,
reference to
JasperreportExporterFactory |
void |
setJasperreporteExporterFactory(java.lang.String clsnm) |
void |
setLocale(java.util.Locale locale)
Sets the output file locale.
|
void |
setParameters(java.util.Map<java.lang.String,java.lang.Object> 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.
|
getAlign, getContent, getName, getScrolling, isAutohide, isChildable, renderProperties, service, setAlign, setAutohide, setName, setScrolling
addSclass, clone, evalCSSFlex, focus, getAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getPropertyAccess, getRenderdefer, getSclass, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZindex, getZIndex, removeSclass, removeSclass, setAction, setClass, setDraggable, setDroppable, setFocus, setHeight, setHeight0, setHeightDirectly, setHflex, setHflex0, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTabindex, setTabindex, setTooltiptext, setTop, setTopDirectly, setVflex, setVflex0, setVflexDirectly, setWidth, setWidth0, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly
addAnnotation, addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, enableBindingAnnotation, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getCallback, getChildren, getClientAttribute, getClientDataAttribute, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, insertBefore, invalidatePartial, isInitialized, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, replace, response, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisible, setVisibleDirectly, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
invalidatePartial
public Jasperreport()
public Jasperreport(java.lang.String src)
public java.lang.String getSrc()
public void setSrc(java.lang.String src)
If src is changed, the whole component is redrawn.
setSrc
in class Iframe
src
- The compiled file (jasper file). If null or empty, nothing is
included.Iframe.setContent(org.zkoss.util.media.Media)
public void setContent(Media media)
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.
setContent
in class Iframe
media
- the media to display.setSrc(java.lang.String)
public java.util.Map<java.lang.String,java.lang.Object> getParameters()
Default: null.
public void setParameters(java.util.Map<java.lang.String,java.lang.Object> parameters)
"exportParameter"
and value as
another parameter Map.
For example:
String key = JRXlsAbstractExporterParameter.PROPERTY_ONE_PAGE_PER_SHEET.toString();
Map parameters = new HashMap();
Map exportParams = new HashMap();
exportParams.put(key, false);
parameters.put("exportParameter", exportParams);
report.setParameters(parameters);
parameters
- use to fill the reportpublic void setHibernate(boolean hibernate)
public boolean isHibernate()
Default: false
public net.sf.jasperreports.engine.JRDataSource getDatasource()
Default: null.
public void setDatasource(net.sf.jasperreports.engine.JRDataSource dataSource)
dataSource
- use to fill the reportpublic void setDataConnection(java.sql.Connection connection)
connection
- use to fill the reportpublic java.sql.Connection getDataConnection()
Default: null
public java.lang.String getType()
Default: pdf.
public void setType(java.lang.String type)
type
- type of output file. If type is null, assign it a default value "pdf".public java.util.Locale getLocale()
Default: null (means the ZK default, Locales.getCurrent()
)).
getLocale() |
getParameters() with a valueassociated with JRParameter.REPORT_LOCALE |
What is used |
X | ignored | X |
null | Y | Y |
null | null | Locales.getCurrent() |
public void setLocale(java.util.Locale locale)
locale
- the locale. If null, the ZK default is used
(Locales.getCurrent()
).getLocale()
public java.lang.String getExportName()
public void setExportName(java.lang.String exportName)
exportName
- the export file namejava.lang.IllegalArgumentException
- if exportName is empty or null.public void setJasperreporteExporterFactory(JasperreportExporterFactory factory)
JasperreportExporterFactory
factory
- public void setJasperreporteExporterFactory(java.lang.String clsnm) throws java.lang.NoSuchMethodException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException, java.lang.ClassNotFoundException, java.lang.IllegalAccessException
clsnm
- java.lang.NoSuchMethodException
java.lang.InstantiationException
java.lang.reflect.InvocationTargetException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
setJasperreporteExporterFactory(JasperreportExporterFactory)
public JasperreportExporterFactory getJasperreporteExporterFactory()
protected java.lang.String getEncodedSrc()
Iframe
Iframe.getSrc()
).getEncodedSrc
in class Iframe
public java.lang.Object getExtraCtrl()
HtmlBasedComponent
Default: creates an instance of HtmlBasedComponent.ExtraCtrl
.
getExtraCtrl
in interface ComponentCtrl
getExtraCtrl
in class Iframe
Cropper
.ComponentCtrl.getExtraCtrl()
public Media getReport()
public void invalidate()
Component
If the application is totally controlled by the server side (i.e., you don't write client codes), you rarely need to access this method.
It can be called only in the request-processing and event-processing phases. However, it is NOT allowed in the rendering phase.
invalidate
in interface Component
invalidate
in class AbstractComponent
Copyright © 2005-2021 Potix Corporation. All Rights Reserved.