Hi there
I have a table with 4 cells that works fine for my report; essentially a row header and then data, row header then data
I have however a set of data that i could do to have with a single row header and then 4 pieces of data.
To do this i need to merge the remaining 3 cells (which I have done with colspan) and then insert another table with 4 cells in it into the merged cell if that makes sense.
What i did was create a second table and then just try and add it, but it truncs the rest of my table at that point. how can i achieve this?
my outline code is shown below
'Row in existing table
MyRow = MyHeaderTable.Rows.Add(14, Font.Helvetica, 9)
'Row header in existing table
MyRow.Cells.Add("Header", Font.HelveticaBold, 9)
'subtable
Dim subtable As Table = New Table(0, 0, 20, 100, Font.Helvetica, 9)
subtable.Columns.Add(20)
subtable.Columns.Add(30)
subtable.Columns.Add(10)
subtable.Columns.Add(40)
Dim mysubrow As Row = subtable.Rows.Add(12)
mysubrow.Cells.Add("a")
mysubrow.Cells.Add("b")
mysubrow.Cells.Add("c")
mysubrow.Cells.Add("d")
'add subtable to cell and set properties
Dim mycell As Cell = MyRow.Cells.Add(subtable)
mycell.ColumnSpan = 3
mycell.Align = CellAlign.Center
Thanks for any help
Table in Table
Re: Table in Table
Support · Sep 3, 2009Hello,
You can add table within another table's cell without any problem. Please make sure that you are adding the data correctly to the main table.
In your sample code you have the "MyRow" as the row to display the header. It has one cell which displays the text "Header". Again you are adding the sub table to this row as another cell and spanning it to 3 columns. Is this the desired structure of your table? You may have to add another row to the main table and then add the sub table to that row's cell.
If this is not your requirement, then please be more specific about the requirement you have and the desired output table structure. You can also send a sample output to our [^a|mailto:support@cete.com|Support Team^] so that they can help you further.
Thanks,
ceTe Software Support Team.
Re: Table in Table
Forum member · Sep 3, 2009Hi there
I have been playing with one of your examples and i can get it wokring in your code by using an AreaGroup
I assume that this was the problem
Re: Table in Table
Forum member · Sep 3, 2009no it wasnt, was my incompetent typing
have it working with and without areagroup now
thx