public class Jasperreport
extends org.zkoss.zul.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 |
| Constructor and Description |
|---|
Jasperreport() |
Jasperreport(String src) |
| Modifier and Type | Method and Description |
|---|---|
Connection |
getDataConnection()
Returns the JasperReports Data Connection.
|
net.sf.jasperreports.engine.JRDataSource |
getDatasource()
Returns the JasperReports DataSource.
|
protected String |
getEncodedSrc() |
String |
getExportName()
Returns the export file name for the download if any,
the full name will be exportName + "." + format.
|
Object |
getExtraCtrl() |
JasperreportExporterFactory |
getJasperreporteExporterFactory() |
Locale |
getLocale()
Returns the output file locale.
|
Map<String,Object> |
getParameters()
Returns the JasperReports Parameters.
|
org.zkoss.util.media.Media |
getReport()
Returns a AMedia contains report's byte stream.
|
String |
getSrc()
Returns the source (jasper file).
|
String |
getType()
Returns the output file type.
|
boolean |
isHibernate()
Returns whether enable the hibernate data source.
|
protected void |
renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) |
void |
setContent(org.zkoss.util.media.Media media)
Sets the content directly.
|
void |
setDataConnection(Connection connection)
Sets the JasperReports Data Connection.
|
void |
setDatasource(net.sf.jasperreports.engine.JRDataSource dataSource)
Sets the JasperReports DataSource.
|
void |
setExportName(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(String clsnm) |
void |
setLocale(Locale locale)
Sets the output file locale.
|
void |
setParameters(Map<String,Object> parameters)
Sets the JasperReports Parameters.
|
void |
setSrc(String src)
Sets the source (jasper file).
|
void |
setType(String type)
Sets the output file type.
|
getAlign, getContent, getName, getScrolling, isAutohide, isChildable, service, setAlign, setAutohide, setName, setScrollingaddSclass, 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, setZIndexDirectlyaddAnnotation, 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, invalidate, 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, willSerializepublic Jasperreport()
public Jasperreport(String src)
public String getSrc()
getSrc in class org.zkoss.zul.Iframepublic void setSrc(String src)
If src is changed, the whole component is redrawn.
setSrc in class org.zkoss.zul.Iframesrc - The compiled file (jasper file). If null or empty, nothing is
included.public void setContent(org.zkoss.util.media.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 org.zkoss.zul.Iframemedia - the media to display.setSrc(java.lang.String)public Map<String,Object> getParameters()
Default: null.
public void setParameters(Map<String,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(Connection connection)
connection - use to fill the reportpublic Connection getDataConnection()
Default: null
public String getType()
Default: pdf.
public void setType(String type)
type - type of output file. If type is null, assign it a default value "pdf".public 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(Locale locale)
locale - the locale. If null, the ZK default is used
(Locales.getCurrent()).getLocale()public String getExportName()
public void setExportName(String exportName)
exportName - the export file nameIllegalArgumentException - if exportName is empty or null.public void setJasperreporteExporterFactory(JasperreportExporterFactory factory)
JasperreportExporterFactoryfactory - public void setJasperreporteExporterFactory(String clsnm) throws NoSuchMethodException, InstantiationException, InvocationTargetException, ClassNotFoundException, IllegalAccessException
clsnm - NoSuchMethodExceptionInstantiationExceptionInvocationTargetExceptionClassNotFoundExceptionIllegalAccessExceptionsetJasperreporteExporterFactory(JasperreportExporterFactory)public JasperreportExporterFactory getJasperreporteExporterFactory()
protected String getEncodedSrc()
getEncodedSrc in class org.zkoss.zul.Iframepublic Object getExtraCtrl()
getExtraCtrl in interface org.zkoss.zk.ui.sys.ComponentCtrlgetExtraCtrl in class org.zkoss.zul.Iframepublic org.zkoss.util.media.Media getReport()
protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer)
throws IOException
renderProperties in class org.zkoss.zul.IframeIOExceptionCopyright © 2024. All rights reserved.