Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Cancel an element's rendering
Cancel an element's rendering [message #1239273] Mon, 03 February 2014 20:48 Go to next message
osuwariboy Mising name is currently offline osuwariboy Mising nameFriend
Messages: 24
Registered: December 2010
Junior Member
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 10:42 Go to previous messageGo to next message
Laura Gutierrez is currently offline Laura GutierrezFriend
Messages: 1
Registered: February 2014
Junior Member
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 08:51 Go to previous messageGo to next message
donino donino is currently offline donino doninoFriend
Messages: 183
Registered: July 2011
Senior Member
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 18:25 Go to previous messageGo to next message
osuwariboy Mising name is currently offline osuwariboy Mising nameFriend
Messages: 24
Registered: December 2010
Junior Member
Thanks, it worked perfectly Smile
Re: Cancel an element's rendering [message #1297243 is a reply to message #1240540] Tue, 15 April 2014 14:29 Go to previous message
Mike Wulkan is currently offline Mike WulkanFriend
Messages: 147
Registered: July 2009
Senior Member
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: Sat May 04 06:08:08 GMT 2024

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

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

Back to the top