Hi,
I want to create a Table with two Rows in the Header and the two rows have different count of cells.
It shout seems like the screenshot.
I tried it with the following code:
Dim table As Spire.Doc.Table = New Spire.Doc.Table(docMonatsbericht)
table.ResetCells(dtDaten.Rows.Count + 2, 7)
Dim row As TableRow
Dim intWidth As Integer
' Überschrift Zeile 1
row = table.Rows(0)
row.IsHeader = True
row.Height = 35
row.HeightType = TableRowHeightType.Exactly
row.RowFormat.BackColor = Color.Gray
For i As Integer = 0 To 6
row.Cells(i).CellFormat.VerticalAlignment = VerticalAlignment.Middle
Dim p As Paragraph = row.Cells(i).AddParagraph()
p.Format.HorizontalAlignment = Spire.Doc.Documents.HorizontalAlignment.Center
Select Case i
Case 0
txtRange = p.AppendText("Chance")
intWidth = 65
Case 1, 4
txtRange = p.AppendText("Angebots-summe")
intWidth = 65
Case 2, 5
txtRange = p.AppendText("Anzahl")
intWidth = 65
Case 3, 6
txtRange = p.AppendText("AE")
intWidth = 65
End Select
row.Cells(i).Width = intWidth
Next i
' Überschrift Zeile 2
row = table.Rows(1)
row.IsHeader = True
row.Height = 35
row.HeightType = TableRowHeightType.Exactly
row.RowFormat.BackColor = Color.Gray
For i As Integer = 0 To 2
row.Cells(i).CellFormat.VerticalAlignment = VerticalAlignment.Middle
Dim p As Paragraph = row.Cells(i).AddParagraph()
p.Format.HorizontalAlignment = Spire.Doc.Documents.HorizontalAlignment.Center
Select Case i
Case 0
txtRange = p.AppendText("")
intWidth = 65
Case 1
txtRange = p.AppendText("Aktuelle Jahr")
intWidth = 3 * 65
Case 2
txtRange = p.AppendText("kummuliert")
intWidth = 3 * 65
End Select
row.Cells(i).Width = intWidth
Next i
But I get also seven cells in the second row. How can I reduce the count on three cells?
Thanks for answer,
Oliver