Free Support Forum - aspose.com

Unable to fix the column width

Hi,

1.We are trying to create a dynamic table using Aspose in Lotus Notes, using document builder for the same.

Once the table get created, if a word is too long for to fit within the column(using cellfomat.width=50), then the text pushes the column formatting of the next column instead of wrapping the etxt to the next line in the same column.

The below code is used:

Call builder.StartTable()

'builder.Rowformat.AllowAutofit=False

cellFormat.wraptext=true - DOES NOT WORK

' Insert a cell

Call builder.InsertCell()

cellFormat.Width = 600

builder.Write("Description of Item(s) Requested")

Please let us know how to autofit the column to fixed column width(This is the same property that is present in MS word)

This is very urgent. Thanks a lot.


This message was posted using Page2Forum from DocumentBuilder Properties - Aspose.Words for .NET

Hello

Thanks fot your request. Please try using the following code:

Document doc = new Document();

DocumentBuilder builder = new DocumentBuilder(doc);

// Insert a cell

builder.InsertCell();

builder.CellFormat.FitText = true;

builder.CellFormat.WrapText = true;

builder.CellFormat.Width = 25;

builder.Writeln("Description of Item(s) Requested");

// Insert a cell

builder.InsertCell();

builder.CellFormat.Width = 300;

builder.Writeln("Test Test");

builder.EndRow();

builder.EndTable();

doc.Save("C:\\Temp\\out.doc");

Best regards,