Skip to main content



      Home
Home » Archived » BIRT » Cancel an element's rendering
Cancel an element's rendering [message #1239273] Mon, 03 February 2014 15:48 Go to next message
Eclipse UserFriend
Hi, I have a report with three tables of which only one is supposed to be visible at once. I did that because we have three separate groups of customers and the layouts are different for each group.

Anyway, right now, the report works, but I realized that setting the "visibility" property to show only one of the tables means the two other tables will still be rendered even though they're not visible resulting in a lot of unnecessary treatment.

So, I was wondering if it's possible to either cancel an element's "render" event or just delete an element dynamically through scripting.

Thanks in advance,

Osu
Re: Cancel an element's rendering [message #1239510 is a reply to message #1239273] Tue, 04 February 2014 05:42 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

I have the same problem, if someone could help ☺

Thank you!
Re: Cancel an element's rendering [message #1240335 is a reply to message #1239510] Thu, 06 February 2014 03:51 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

The key point is to set a name to the elements we want to remove dynamically. Then we can do something like this in the "beforeFactory" script:

var myelement = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("myElementName");

myelement.drop();



Here is a full example of the beforeFactory method, where we drop some elements based on report parameters:

var fiche = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("tableFiche");
var stock = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("tableStock");
var ventes = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("tableVentes");

/**************HANDLE DISPLAYED ITEMS ********************/

if (params["Vue"].value == "fiche"){
	stock.drop();
	ventes.drop();
}else if(params["Vue"].value=="stock"){
	fiche.drop();
	ventes.drop();
}else if(params["Vue"].value=="ventes"){
	stock.drop();
	fiche.drop();
}


Re: Cancel an element's rendering [message #1240540 is a reply to message #1240335] Thu, 06 February 2014 13:25 Go to previous messageGo to next message
Eclipse UserFriend
Thanks, it worked perfectly Smile
Re: Cancel an element's rendering [message #1297243 is a reply to message #1240540] Tue, 15 April 2014 10:29 Go to previous message
Eclipse UserFriend
Also see https://bugs.eclipse.org/bugs/show_bug.cgi?id=373415
Previous Topic:What is the problem with this error: java.lang.NullPointerException
Next Topic:How to avoid useless queries to be executed
Goto Forum:
  


Current Time: Fri Jul 04 04:43:32 EDT 2025

Powered by FUDForum. Page generated in 0.05698 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top