Hide table Column

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

Comments

  • edited December 1969
    Ok, I'm now a pain in the ****, 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
  • mwilliamsmwilliams BIRT Guru
    edited December 1969
    Glad you found a solution to your issue. If you ever have any questions, let us know!

    Regards,

    Michael Williams

    eSignLive Evangelism & Community Manager | eSignLive by VASCO
     
    Find me on:
    Twitter
    Facebook
    Blog

    LinkedIn

    eSignLive Developer Community
     
    Email me:
    Google: mwilliams.silanis@gmail.com

  • edited December 1969
    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.
  • mwilliamsmwilliams BIRT Guru
    edited July 2011
    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

    eSignLive Evangelism & Community Manager | eSignLive by VASCO
     
    Find me on:
    Twitter
    Facebook
    Blog

    LinkedIn

    eSignLive Developer Community
     
    Email me:
    Google: mwilliams.silanis@gmail.com

  • edited December 1969


    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.
  • mwilliamsmwilliams BIRT Guru
    edited December 1969
    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

    eSignLive Evangelism & Community Manager | eSignLive by VASCO
     
    Find me on:
    Twitter
    Facebook
    Blog

    LinkedIn

    eSignLive Developer Community
     
    Email me:
    Google: mwilliams.silanis@gmail.com

  • edited December 1969


    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.

  • edited December 1969
    'mwilliams' wrote on '18:


    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" .
  • edited December 1969
    'Bhumi wrote on '18:

    'mwilliams' wrote on '18:


    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" .
  • edited December 1969
    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);
    }
  • mwilliamsmwilliams BIRT Guru
    edited December 1969
    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

    eSignLive Evangelism & Community Manager | eSignLive by VASCO
     
    Find me on:
    Twitter
    Facebook
    Blog

    LinkedIn

    eSignLive Developer Community
     
    Email me:
    Google: mwilliams.silanis@gmail.com

  • edited December 1969


    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
  • hi,I am creating dynamic Table using cross tab .and its working fine..now my requirment is to split the table as per 


    user input number.


     


    example :


    My Table 


     


        A B C D E


    x  1 2  3 4 5


    y  1 2  3 4 5


    z  1 2  3 4 5


     


    user input :3


    table 1


        A B  C


    x  1  2  3 


    y  1  2  3


    z  1  2  3


     


    table 2


        D E


    x  4  5


    y  4  5


    z  4  5

Sign In or Register to comment.