This is a migrated thread and some comments may be shown as answers.

Delete row from a table

1 Answer 254 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 06 Apr 2012, 03:57 PM
We have nested tables. Table B is in Row 14 of Table A. When the Table B has no data we would like to not show it and this we did by setting its visible to false. But the white space created by this(row14) is showing up in the report.
How to remove row14 when it is not applicable?

1 Answer, 1 is accepted

Sort by
0
Elian
Telerik team
answered on 09 Apr 2012, 12:15 PM
Hi David,

You can set the row height in the parent table programmatically in the constructor - this way in the designer the row will be normal-sized (and you will be able to work with it). When the report is generated the initial height of the row will be very small. If the table is visible it will make the row grow to fit it. To set the row height you need to do a couple of things:

//1. Set the row height itself
table1.Body.Rows[0] = new TableBodyRow(Unit.Cm(0.1));
 
//2. Set the height of all items that are in the row
//In this case the parent table has only 1 column and I have put a Panel that holds the inner table (it recommended putting a panel first, then the table)
panel1.Height = Unit.Cm(0.1);
//... for the rest of the items

Using this approach you will still need to make the table invisible (not the panel, only the table) so the row can shrink.
All the best,
Elian
the Telerik team
NEW in Q1'12: Telerik Report Designer (Beta) for ad-hoc report creation. Download as part of Telerik Reporting Q1 2012. For questions and feedback, use the new Telerik Report Designer Forum.
Tags
General Discussions
Asked by
David
Top achievements
Rank 1
Answers by
Elian
Telerik team
Share this question
or