views:

564

answers:

1

Hi,

I have a rdlc report in which I have a table with 6 columns. Of these 6 columns, the visiblity of the 2nd and 4th column are toggled. i.e. if 2nd column is visible, 4th is not visible and vice versa. The report displayed properly with these settings. Then a new row was added to the table. All the cells in this row were merged and a rectangle added to this row. Then a few textboxes were added to this rectange. Now when this report is run, the display of the table is disturbed. An empty column in shown before the last column and the header of the last column also appears displaced.

After a few permutations, I zeroed in the actual problem. If you have a table with a row with merged cells and a rectangle in the merged cells, then hiding any column does not disturb the display. But if you add a textbox to the rectangle, the display of the table is disturbed as mentioned above.

Is this an inherent problem in RDLC reports or I am missing something here ?

Note, the reports are run in local mode and enviroment is Visual Studio 2005.

A: 

This seems to be defect in ReportViewer. Setting a column's hidden property to true should be sufficient to complelety obscure the column. However in this case, along with setting its hidden property to true you also have to set its width to 0.0 inches to completely obscure it.


I am discarding my earlier answer. The solution described above does work but has some glitches.

A more proper method is allocating a new column array to the column collection of the RDLC report table via deserialization and then serializing the report back. Deserializing an RDLC report exposes it as an Object. This column array will contain the original table columns except the ones that are to be hidden. The solution is complicated but effective.

devanalyst