Jump to content

BIRT Developer Center Download


Photo
- - - - -

Hide table Column


  • Please log in to reply
12 replies to this topic

#1 jfreak53

jfreak53

    Advanced Member

  • Members
  • PipPipPip
  • 63 posts

Posted 08 December 2010 - 08:25 AM

Ok I have tried a few time and can't get it to go. What I want to do is hide X numbered column in my table if condition is true.

I tried this:

this.getColumn(2).addHideRule(true);

But not go on the OnPrepare on the table. All I want to do is just hide that column and none other. I know there is a visibility property and I can check hide element and it works, but I need to do it with script.
http://www.microthosting.com -- Free reseller web hosting, Hosting, VPS, FREE SMALL HOSTING!!!
"FORTRAN is not a language. It's a way of turning a multi-million dollar mainframe, into a $50 programmable scientific calculator."
http://www.microtronix-tech.com -- Web design and programming

#2 jfreak53

jfreak53

    Advanced Member

  • Members
  • PipPipPip
  • 63 posts

Posted 08 December 2010 - 09:54 AM

Ok, I'm now a pain in the butt, sorry but I figured it out finally. I didn't know that under visibility for each element there was the expression part, I thought I was just a simple boolean that was true or false. But by entering params["name"].value == false I made it hide when I needed and display when needed. So figured it out, thanks for anyone racking their brain to figure out why I was asking such a simple thing ha ha
http://www.microthosting.com -- Free reseller web hosting, Hosting, VPS, FREE SMALL HOSTING!!!
"FORTRAN is not a language. It's a way of turning a multi-million dollar mainframe, into a $50 programmable scientific calculator."
http://www.microtronix-tech.com -- Web design and programming

#3 mwilliams

mwilliams

    BIRT Guru

  • Administrators
  • 14159 posts

Posted 08 December 2010 - 02:13 PM

Glad you found a solution to your issue. If you ever have any questions, let us know!
Regards,

Michael Williams

Actuate Corporation – The BIRT Company™

Instantly add interactivity, scheduling, sharing, live Excel exporting, and JavaScript integration capabilities to your BIRT application with the new, free BIRT server, BIRT iHub F-Type.
 
Find me on:
Twitter
Facebook
Blog

LinkedIn
 
Email me:
Google: mwilliams.actuate@gmail.com

#4 Bhumi U.

Bhumi U.

    Member

  • Members
  • PipPip
  • 28 posts

Posted 15 July 2011 - 12:08 PM

Hi, I have truoble displaying no. of column in birt report dynamically. Number of header columns is variable(max = 4). This is based on the max number of supervisors in the entire report. Here are some examples for different scenario. Ex:1 No of supervisors: Acct1: 0 Acct2: 1 In this case, max number of supervisor per report is one ,So report will generate 2 columns , (one for Supervisor, one for Corp) Ex:2 No. of supervisors: Acct1: 2 Acct2: 1 In this case, max number of supervisors per report are 2,So report will generate 3 columns , (Two for Supervisor, one for Corp) Ex:3 No of supervisors: Acct1: 2 Acct2: 3 Acct 3: 10 In this case, max number of supervisors per report are 10,So report will generate 4 columns , (Three for Supervisor, one for Corp)So Max number of column can be displayed for supervisor are 3. Ex: 4 # of supervisors: Acct1: 0 In this case, No supervisor is available for account,So report will generate 1 column , (one for Corp) Please find attached spread sheet with sample output display of columns. How can i display all columns dynamically?I am new to birt report design.

Attached Files



#5 mwilliams

mwilliams

    BIRT Guru

  • Administrators
  • 14159 posts

Posted 15 July 2011 - 07:18 PM

What does your actual data look like? You'll have to set up your table with your 4 columns and then hide the ones you don't need.
Regards,

Michael Williams

Actuate Corporation – The BIRT Company™

Instantly add interactivity, scheduling, sharing, live Excel exporting, and JavaScript integration capabilities to your BIRT application with the new, free BIRT server, BIRT iHub F-Type.
 
Find me on:
Twitter
Facebook
Blog

LinkedIn
 
Email me:
Google: mwilliams.actuate@gmail.com

#6 Bhumi U.

Bhumi U.

    Member

  • Members
  • PipPip
  • 28 posts

Posted 17 July 2011 - 07:51 PM

What does your actual data look like? You'll have to set up your table with your 4 columns and then hide the ones you don't need.


Right now,I get the output file display with 4 columns,which are fixed.But i want all 4 columns to be displayed dynamically as per data set field values.

#7 mwilliams

mwilliams

    BIRT Guru

  • Administrators
  • 14159 posts

Posted 18 July 2011 - 09:46 AM

I want to know what your data looks like in your dataSet and what you want the report to do. Then I'll make a sample report showing you how with this info.
Regards,

Michael Williams

Actuate Corporation – The BIRT Company™

Instantly add interactivity, scheduling, sharing, live Excel exporting, and JavaScript integration capabilities to your BIRT application with the new, free BIRT server, BIRT iHub F-Type.
 
Find me on:
Twitter
Facebook
Blog

LinkedIn
 
Email me:
Google: mwilliams.actuate@gmail.com

#8 Bhumi U.

Bhumi U.

    Member

  • Members
  • PipPip
  • 28 posts

Posted 18 July 2011 - 01:15 PM

I want to know what your data looks like in your dataSet and what you want the report to do. Then I'll make a sample report showing you how with this info.



#9 Bhumi U.

Bhumi U.

    Member

  • Members
  • PipPip
  • 28 posts

Posted 18 July 2011 - 02:07 PM

[quote name='mwilliams' date='18 July 2011 - 11:46 AM' timestamp='1311011208' post='80181']
I want to know what your data looks like in your dataSet and what you want the report to do. Then I'll make a sample report showing you how with this info.


My Dataset have total 5 fields.
1>Account Name
2>Supervisor one
3>Supervisor two
4>Supervisor Three
5>Supervisor Four

My report design file is having this five fields set into table column.And it will display all five columns for now.But i just wants my report to display columns dynamically as per Max number of supervisor in report for perticular account.
Example:
Suppose there are total 4 accounts in report.

Account1 : Supervisor 1,Supervisor 2;
Account2 : Supervisor 1;
Account3 : Supervisor 1;
Account4 : -

So maximum number of supervisor are 2 per report.So I just wants to display total four columns in generated report.
1>Account Name 2>Supervisor one 3>Supervisor Two 4>Supervisor Three.(one more column than max number of supervisor.)

You can ping me on "ubhumi@yahoo.com" .

Attached Files



#10 Bhumi U.

Bhumi U.

    Member

  • Members
  • PipPip
  • 28 posts

Posted 19 July 2011 - 12:48 PM

[quote name='Bhumi U.' date='18 July 2011 - 04:07 PM' timestamp='1311026877' post='80206']
[quote name='mwilliams' date='18 July 2011 - 11:46 AM' timestamp='1311011208' post='80181']
I want to know what your data looks like in your dataSet and what you want the report to do. Then I'll make a sample report showing you how with this info.


My Dataset have total 5 fields.
1>Account Name
2>Supervisor one
3>Supervisor two
4>Supervisor Three
5>Supervisor Four

My report design file is having this five fields set into table column.And it will display all five columns for now.But i just wants my report to display columns dynamically as per Max number of supervisor in report for perticular account.
Example:
Suppose there are total 4 accounts in report.

Account1 : Supervisor 1,Supervisor 2;
Account2 : Supervisor 1;
Account3 : Supervisor 1;
Account4 : -

So maximum number of supervisor are 2 per report.So I just wants to display total four columns in generated report.
1>Account Name 2>Supervisor one 3>Supervisor Two 4>Supervisor Three.(one more column than max number of supervisor.)

You can ping me on "ubhumi@yahoo.com" .
[/quote]

#11 Bhumi U.

Bhumi U.

    Member

  • Members
  • PipPip
  • 28 posts

Posted 19 July 2011 - 12:57 PM

Hi .. I finally got the solution for my issue.I have created global variable in my event handler to find out max number of supervisor in report and used that variable in my reportDesign file to check the visibility of the column based on supervisor count. Ex.. if (reportContext.getGlobalVariable("MAX_SUPERVISOR_COUNT") >= 1){ (false); } else{ (true); }

#12 mwilliams

mwilliams

    BIRT Guru

  • Administrators
  • 14159 posts

Posted 19 July 2011 - 01:18 PM

That's pretty much the same as what I would have done. I emailed you to clarify the data, you can disregard that email. Let us know whenever you have questions! :)
Regards,

Michael Williams

Actuate Corporation – The BIRT Company™

Instantly add interactivity, scheduling, sharing, live Excel exporting, and JavaScript integration capabilities to your BIRT application with the new, free BIRT server, BIRT iHub F-Type.
 
Find me on:
Twitter
Facebook
Blog

LinkedIn
 
Email me:
Google: mwilliams.actuate@gmail.com

#13 Bhumi U.

Bhumi U.

    Member

  • Members
  • PipPip
  • 28 posts

Posted 19 July 2011 - 01:42 PM

That's pretty much the same as what I would have done. I emailed you to clarify the data, you can disregard that email. Let us know whenever you have questions! :)



Sure.Thanks Williams