-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello,
I've a window that contains a jasperreport and three buttons when I close this window I get a error message complaining that some component couldn't be found, see:
14/07/2009 11:28:04 org.zkoss.zk.au.http.AuDynaMediar process:130
SEVERE: Failed to load media, /view/ga4i1/z_a4_t4/0/D:/Projetos/Java/vc-web/vc-grails/target/resources/reports/PedidoVendaResumo.html
>>org.zkoss.zk.ui.ComponentNotFoundException: Component not found: z_a4_t4
>> at org.zkoss.zk.ui.impl.DesktopImpl.getComponentByUuid(DesktopImpl.java:413)
The report is displayed correctly and this message only appears when the window is closed. This is the window code:
<window id="wndPedidoVendaResumo" apply="${pedidoVendaResumoComposer}"> <jasperreport id="report" height="95%" /> <n:span class="right-toolbar"> <button id="btnVisualizar" label="Visualizar Impressão" image="/images/print_preview16.png"/> <button id="btnPdf" label="Imprimir em PDF" image="/images/pdf16.png"/> <button id="btnFechar" label="Fechar" image="/images/cancel16.gif"/> </n:span> </window>
And the composer code:
def afterCompose = { // using GrailsComposer, don't worry it works. doHtmlReport() } public void onClick_btnFechar() { wndPedidoVendaResumo.detach() } private def doHtmlReport() { report.src = reportUtils.reportFile("PedidoVendaResumo").path report.parameters = defaultReportParams() report.datasource = new JRBeanCollectionDataSource() report.type = "html" }
The code is working but I'm getting this annoying message in the log.
What is wrong? How could I solve this?
Regards,
Felipe Cypriano
Hi,
I found that the missing component is always the iframe generated by jasperreport component.
If the component is just declared (nothing sets it's src) the error message don't appear. As soon as a report is loaded - no matter if type is html or pdf - when the jasperreport's parent window get closed the message complaing about a "not found component" is show in server log.
Using the jasperreport from zkdemo, change it's code to:
<zk> <window id="win"> Choice the file type : <listbox id="format" mold="select" onSelect="showReport()" > <listitem label="PDF" value="pdf" selected="true" /> <listitem label="XML" value="xml" /> <listitem label="HTML" value="html" /> <listitem label="Word (RTF)" value="rtf" /> <listitem label="Excel" value="xls" /> <listitem label="Excel (JXL)" value="jxl" /> <listitem label="CSV" value="csv" /> <listitem label="OpenOffice (ODT)" value="odt" unless="false"/> </listbox> <button label="Report!" onClick='showReport()'/> <jasperreport id="report" height="360px" /> <button label="Close" onClick="win.detach()"/> <zscript> import org.zkoss.zkdemo.userguide.CustomDataSource; void showReport() { //Preparing parameters Map parameters = new HashMap(); parameters.put("ReportTitle", "Address Report"); parameters.put("DataFile", "CustomDataSource from java"); report.setSrc("/userguide/data/jasperreport.jasper"); report.setParameters(parameters); report.setDatasource(new CustomDataSource()); report.setType((String) format.getSelectedItem().getValue()); } </zscript> </window> </zk>
After click on Report button, click on Close and watch the server log to see the error message.
Is this a bug?
Regards,
Felipe Cypriano
Has anyone reproduced this problem?
Yes, I get this all the time. It think it's a bug and you should file a bug report.
I did this, just forgot to post here. [a href=http://sourceforge.net/tracker/index.php?func=detail&aid=2822416&group_id=152762&atid=785191"]Bug ID: 2822416
Thanks to confirm that this isn't happening only with me.
HI ,
i am using zk6.0.2 and still getting same exception. Is this bug fixed or not?
Can you post a runnable example for us to clarify the issue?
hi: I need a report with an image and a barcode. but when I run I get an exception:
ERROR org.zkoss.zk.ui.impl.UiEngineImpl - java.lang.NullPointerException: null at net.sf.jasperreports.engine.fill.JRFillImage.evaluateImage(JRFillImage.java:1034) ~[jasperreports-4.0.1.jar:4.0.1 ] at net.sf.jasperreports.engine.fill.JRFillImage.evaluate(JRFillImage.java:1004) ~[jasperreports-4.0.1.jar:4.0.1 ] at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:258) ~[jasperreports-4.0.1.jar:4.0.1 ]
someome can help me.
Asked: 2009-07-14 14:41:07 +0800
Seen: 632 times
Last updated: Nov 17 '14