Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » How to Hide Table Detail Row Runtime
How to Hide Table Detail Row Runtime [message #786432] Mon, 30 January 2012 12:18 Go to next message
karvesh ghunsam is currently offline karvesh ghunsamFriend
Messages: 95
Registered: July 2011
Member
Dear All,

I have created a table at runtime.
I am trying to hide the detail row depending on some circumstances.

I am using the code for the moment:

detail =  table.getDetail( ).get( 0 );
if(params["paramDetail"] == "N")
{
	detail.setProperty("height","0.01mm");
}


Is there a better way? I tried:
detail.setProperty("visibility","hidden"); 


but to no avail
even false does not work.

Could anyone hint me here?

Thanks a lot
Karvesh
Re: How to Hide Table Detail Row Runtime [message #786662 is a reply to message #786432] Mon, 30 January 2012 17:26 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

See this example:
http://www.birt-exchange.org/org/devshare/designing-birt-reports/1459-hide-table-detail-rows-based-on-parameter/

Jason


On 1/30/2012 7:18 AM, karvesh Mising name wrote:
> table.getDetail( ).get( 0 );
Re: How to Hide Table Detail Row Runtime [message #786998 is a reply to message #786662] Tue, 31 January 2012 03:08 Go to previous messageGo to next message
karvesh ghunsam is currently offline karvesh ghunsamFriend
Messages: 95
Registered: July 2011
Member
Dear Jason,

I tried:

table = elementFactory.newTableItem( null, (4 + columnHeaderArray.length), 1, 1, 1 ); 
table.setProperty( "dataSet", "dsAgeing" );
table.setProperty( "name", "tblAgeing" );
if(params["paramDetail"] == "N")
{
	//detail.setProperty("height","0.01mm");
	table.getDetail( ).get( 0 ).drop(); 
}


but to no avail

I get the error:
TypeError: Cannot call method "getContent" of null (/report/method[@name="beforeFactory"]#133) (Element ID:1)

Any clue why?

Please find attached my code just in case

Kind Regards,
Karvesh
Re: How to Hide Table Detail Row Runtime [message #787491 is a reply to message #786998] Tue, 31 January 2012 16:35 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

You need to move this code:

//hide the detail row in case report is summarised
if(params["paramDetail"] == "N")
{
//detail.setProperty("height","0.01mm");
table.getDetail( ).get( 0 ).drop();
}

to the line above:

//------------------------------------------------------
//fianlly add the table to the report

reportDesignHandle.getBody( ).add( table );

Jason

On 1/30/2012 10:08 PM, karvesh Mising name wrote:
> Dear Jason,
>
> I tried:
>
>
> table = elementFactory.newTableItem( null, (4 + columnHeaderArray.length), 1, 1, 1 );
> table.setProperty( "dataSet", "dsAgeing" );
> table.setProperty( "name", "tblAgeing" );
> if(params["paramDetail"] == "N")
> {
> //detail.setProperty("height","0.01mm");
> table.getDetail( ).get( 0 ).drop();
> }
>
>
> but to no avail
>
> I get the error:
> TypeError: Cannot call method "getContent" of null (/report/method[@name="beforeFactory"]#133) (Element ID:1)
>
> Any clue why?
>
> Please find attached my code just in case
>
> Kind Regards,
> Karvesh
Re: How to Hide Table Detail Row Runtime [message #787845 is a reply to message #787491] Wed, 01 February 2012 03:17 Go to previous message
karvesh ghunsam is currently offline karvesh ghunsamFriend
Messages: 95
Registered: July 2011
Member
Dear Jason,

It works fine! Thanks a lot!

Karvesh
Previous Topic:Handling the tab character in XML data sources
Next Topic:Create MySql Dataset at Runtime
Goto Forum:
  


Current Time: Thu Mar 28 10:27:36 GMT 2024

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

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

Back to the top