Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » how can i hide colomn in crossTabs
how can i hide colomn in crossTabs [message #809784] Wed, 29 February 2012 04:03 Go to next message
marina tzerluk is currently offline marina tzerluk
Messages: 13
Registered: February 2012
Junior Member
Hi
i need to hide column of some of the summary feilds in cross tab acording user input.
when i use the visibility option it hides only the mesurer itself but the column still can be visible(it becomes very narrow) in the overveiw window.


does any one has any idea how can i hide the entire column?
Re: how can i hide colomn in crossTabs [message #810817 is a reply to message #809784] Thu, 01 March 2012 10:35 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

You should be able to use a crosstab oncreate script to look for a cell
and set its style display to "none". Look at the attached example.
Also have a look at:

http://birtworld.blogspot.com/2010/02/birt-crosstab-scripting.html

Jason

On 2/29/2012 4:03 AM, marina tzerluk wrote:
> Hi
> i need to hide column of some of the summary feilds in cross tab
> acording user input.
> when i use the visibility option it hides only the mesurer itself but
> the column still can be visible(it becomes very narrow) in the overveiw
> window.
>
>
> does any one has any idea how can i hide the entire column?
Re: how can i hide colomn in crossTabs [message #810822 is a reply to message #809784] Thu, 01 March 2012 10:35 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

You should be able to use a crosstab oncreate script to look for a cell
and set its style display to "none". Look at the attached example.
Also have a look at:

http://birtworld.blogspot.com/2010/02/birt-crosstab-scripting.html

Jason

On 2/29/2012 4:03 AM, marina tzerluk wrote:
> Hi
> i need to hide column of some of the summary feilds in cross tab
> acording user input.
> when i use the visibility option it hides only the mesurer itself but
> the column still can be visible(it becomes very narrow) in the overveiw
> window.
>
>
> does any one has any idea how can i hide the entire column?
Re: how can i hide colomn in crossTabs [message #810915 is a reply to message #810822] Thu, 01 March 2012 12:22 Go to previous messageGo to next message
Steve Schafer is currently offline Steve Schafer
Messages: 1
Registered: July 2009
Junior Member
I just wanted to comment that the technique of hiding a cell doesn't really work for dimension columns because the dimension column itself gets hidden but the heading above doesn't shrink so all the headings are then misaligned. That was my experience recently in BIRT 3.7.
Re: how can i hide colomn in crossTabs [message #810924 is a reply to message #810915] Thu, 01 March 2012 12:33 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Correct Steve, but you should be able to check if it is a header cell in
script and hide it as well.

if( cellInst.getCellType() == "header" ) {
//Get data values see binding tab on crosstab
//if( cellInst.getDataValue("PRODUCTLINE") == "Planes" ){
if( reportContext.evaluate("dimension['ProductGroup']['PRODUCTLINE']")
== "Planes" ){
cellInst.getStyle().display = "none";
}

}


Jason

On 3/1/2012 12:22 PM, Steve Schafer wrote:
> I just wanted to comment that the technique of hiding a cell doesn't
> really work for dimension columns because the dimension column itself
> gets hidden but the heading above doesn't shrink so all the headings are
> then misaligned. That was my experience recently in BIRT 3.7.
Re: how can i hide colomn in crossTabs [message #872675 is a reply to message #809784] Wed, 16 May 2012 11:20 Go to previous messageGo to next message
Prashant Jha is currently offline Prashant Jha
Messages: 18
Registered: September 2011
Junior Member
This is acting weird. I want to hide and shrink the dimension column.
if i write this code:
if(  cellInst.getCellType() == "header" ){
      cellInst.getStyle().display = "none";
}


This hides and shrinks all the headers. But also hides the dimension column on left of cross tab.
However, if I check for the dimension type as here in this code:

if(reportContext.evaluate("dimension['grp_row']['RowNumber']")=="RowNumber") {
			cellInst.getStyle().display = "none";}


This hides the left dimension column header but doesnot shrink it. What am i doing wrong.
Re: how can i hide colomn in crossTabs [message #873171 is a reply to message #872675] Thu, 17 May 2012 12:13 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Row headers are considered headers as well. Why not use the
cellInst.getCellID() for the if statement which will allow you to
control which cell you want to hide. You can get the cell id by looking
at the general properties for the cell (not label or data item). It
will be listed as element id.

Jason

On 5/16/2012 11:20 AM, Prashant Jha wrote:
> This is acting weird. I want to hide and shrink the dimension column.
> if i write this code:
> if( cellInst.getCellType() == "header" ){
> cellInst.getStyle().display = "none";
> }
>
> This hides and shrinks all the headers. But also hides the dimension
> column on left of cross tab. However, if I check for the dimension type
> as here in this code:
>
> if(reportContext.evaluate("dimension['grp_row']['RowNumber']")=="RowNumber")
> {
> cellInst.getStyle().display = "none";}
>
> This hides the left dimension column header but doesnot shrink it. What
> am i doing wrong.
Re: how can i hide colomn in crossTabs [message #896748 is a reply to message #873171] Thu, 19 July 2012 11:01 Go to previous message
Durga Ravi Santhosh Gurajada is currently offline Durga Ravi Santhosh Gurajada
Messages: 6
Registered: February 2012
Junior Member
To hide any column in crosstab,

function onPrepareCell( cell, reportContext )
{
if(cell.getCellID()==95) { //In place of 95 give the column element ID which
//you are going to hide.
cell.getStyle().setDisplay("none");
}
}
Thanks Jason,
It really helped me alot.
Previous Topic:Numbering Rows
Next Topic:Report eating memory in viewer
Goto Forum:
  


Current Time: Thu Jul 31 23:55:23 EDT 2014

Powered by FUDForum. Page generated in 0.02533 seconds