Hi,
First, i apologize because my english is very bad.
My current version: Aspose.Word.Net is 15.9.0.0
To simplify my problem:
I’m trying to create a table with 2 rows.
The first row must have 2 cells:
- 1 cell of 130 mm
- 1 cell of 60 mm
The second row must have 3 cells:
- 1 cell of 80 mm
- 1 cell of 60 mm
- 1 cell of 40 mm
I know that i exceeds a bit the default width of an A4, so, i have to use AutoFitBehavior.FixedColumnWidths to do this.
My main problem is that the first cell of the second row (80 mm) take automatically the width of the first cell of the first row (130 mm) when i use autofit to fixed column widths.
I get to do this when i use autofit to the windows (default behaviour) but then the widths of cells are not correct (not fixed).
My code (sample version):
Dim doctest As New Document()
Dim buildtest As New DocumentBuilder(doctest)
Dim tabtest As Table = buildtest.StartTable()
buildtest.InsertCell()
’ // tabtest.AutoFit(AutoFitBehavior.FixedColumnWidths) (already tested by placing it here)
buildtest.Writeln(“Row 1 Cell 1”)
buildtest.CellFormat.Width = ConvertUtil.MillimeterToPoint(130)
buildtest.InsertCell()
buildtest.Writeln(“Row 1 Cell 2”)
buildtest.CellFormat.Width = ConvertUtil.MillimeterToPoint(60)
buildtest.EndRow()
buildtest.InsertCell()
buildtest.Writeln(“Row 2 Cell 1”)
buildtest.CellFormat.Width = ConvertUtil.MillimeterToPoint(80)
buildtest.InsertCell()
buildtest.Writeln(“Row 2 Cell 2”)
buildtest.CellFormat.Width = ConvertUtil.MillimeterToPoint(60)
buildtest.InsertCell()
buildtest.Writeln(“Row 2 Cell 3”)
buildtest.CellFormat.Width = ConvertUtil.MillimeterToPoint(40)
buildtest.EndRow()
buildtest.EndTable()
tabtest.AutoFit(AutoFitBehavior.FixedColumnWidths)
doctest.Save(System.IO.Path.GetTempPath & “ResultTest.pdf”)
doctest.Save(System.IO.Path.GetTempPath & “ResultTest.docx”)
See attachment for the result (output) of this code.
This code works without problem in version 11.8.0.0 but not works in version 15.9.0.0.
Can you help me?
Thanks!!