0

Closing a window that contains jasperreport gives component not found error

asked 2009-07-14 14:41:07 +0800

fmcypriano gravatar image fmcypriano
612 1 7
http://felipecypriano.com...

updated 2009-07-14 14:43:13 +0800

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

delete flag offensive retag edit

8 Replies

Sort by » oldest newest

answered 2009-07-15 13:36:07 +0800

fmcypriano gravatar image fmcypriano
612 1 7
http://felipecypriano.com...

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

link publish delete flag offensive edit

answered 2009-07-20 12:04:22 +0800

fmcypriano gravatar image fmcypriano
612 1 7
http://felipecypriano.com...

Has anyone reproduced this problem?

link publish delete flag offensive edit

answered 2009-07-20 13:22:54 +0800

caclark gravatar image caclark
1753 2 5
http://clarktrips.intltwi...

Yes, I get this all the time. It think it's a bug and you should file a bug report.

link publish delete flag offensive edit

answered 2009-07-21 11:31:44 +0800

fmcypriano gravatar image fmcypriano
612 1 7
http://felipecypriano.com...

updated 2009-07-21 11:32:18 +0800

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.

link publish delete flag offensive edit

answered 2012-10-22 12:13:01 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

HI ,
i am using zk6.0.2 and still getting same exception. Is this bug fixed or not?

link publish delete flag offensive edit

answered 2012-11-02 04:08:57 +0800

jumperchen gravatar image jumperchen
3909 2 8
http://jumperchen.blogspo... ZK Team

Can you post a runnable example for us to clarify the issue?

link publish delete flag offensive edit

answered 2014-04-16 04:08:25 +0800

Sam2012 gravatar image Sam2012
9

is a bug for IE10, IE11 in my project, please help, zk version is 5.08

link publish delete flag offensive edit

answered 2014-11-17 16:48:07 +0800

fedesacaba gravatar image fedesacaba
1

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.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-07-14 14:41:07 +0800

Seen: 632 times

Last updated: Nov 17 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More