Community
Participate
Working Groups
Build Identifier: M20100211-1343 My columns in the display list are based on selections from a parameter list, So i created a layout that includes all the columns and drop the ones that I don't need based on the parameter. I coded the example, see attachment [hideColumnBasedOnParameter.rptdesign] But when I tried to run this using the preview mode of eclipse and birt web viewer . The columns were not hidden Although, as i had put in log statements to look at column visibility settings after the "hiding code" in onRender method of table. These log statements output correct display property (i.e the columns that should be displayed have property as 'block' and the one's which should not be displayed have value as 'none'). Below are the specifications of BIRT for my machine [Fedora 12]. Viewer Version : 2.6.1 Engine Version: 2.6.1 JRE version: 1.6.0_21 After consulting on the forums (and some experimenting) i found that this code works on Windows machine, but fails in Fedora (probably other linux machines too) Following is the analysis of the tests carried out by me So test cases 1) IDE : Eclipse galileo OS : Fedora 13 (32 bit) Birt version : 2.6.1 2) IDE: Eclipse helios SR1 OS : Fedora 13 (32 bit) Birt version : 2.6.1 3) IDE: Eclipse helios SR1 OS : Windows 7 Birt version : 2.6.1 So for cases 1 and 2 the code did not work, but for the 3rd case, it worked. Reproducible: Always Steps to Reproduce: Case 1 : Fedora 12 1. Use the attached rptdesign on a fresh installation of Eclipse galileo or Eclipse helios SR1 2. Use the preview mode of BIRT and select some parameters from the dropdown list of the report parameters 3. The resultant preview would contain all the columns irrespective of whether this column was selected from the dropdown Case 2 : Windows 1. Use the attached rptdesign on a fresh installation of Eclipse galileo or Eclipse helios SR1 2. Use the preview mode of BIRT and select some parameters from the dropdown list of the report parameters 3. The resultant preview would only contain columns which were selected from the dropdown.
Created attachment 183186 [details] rptdesign file containing the test code rptdesign file containing the test code
Please refer to this forum post for more information http://www.birt-exchange.org/org/forum/index.php/topic/20720-adding-rowscolumns-to-table-at-runtime-based-on-the-results-returned-by-dynamic-dataset/page__view__findpost__p__69875
Use "visibility:collapse" to hide the table column and remove the space it takes. It works in Firefox and IE(8.0, 9.0). The "*display:none" attribute is to make the column hidden in previous IE versions including IE7. So that combine of these two attributes will hide the table columns perfectly in all Firefox and IE versions.
Reopen this issue because of an regression issue that more columns are hidden by mistake.
This reason for this issue is that the detail cells' styles are not set as "display:none" at render time, which should inherit from it's parent(the column element) at design time. To solve this issue, please use the following script in the onPrepare method of the table: cCount=this.getColumnCount(); i=0; j=0; isChosen=""; paramVal=params["paramSelectList"].value; paramLength=params["paramSelectList"].length; while(i<cCount){ while(j<paramLength){ if (this.getDataBindings()[i].name == paramVal[j].toUpperCase()) { isChosen = "yes"; } else { if (isChosen == "yes"){ isChosen = isChosen; } else{ isChosen = "no"; } } j++; } if (isChosen == "yes"){ this.getColumn(i).getStyle().display = "block"; } else{ this.getColumn(i).getStyle().display = "none"; } j=0; i++; isChosen = ""; }