Free Support Forum - aspose.com

Autofit Issue

Hi

I am generating a word document in which I’m generating the table dynamically, now I need the cells to resize to autofit to the text. I have tried using “builder.rowformat.autofit = true”, but the cell does not autofit. Here is my code<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Do While (rsOperationLLo.Fields.Item("I_FLAG_TRANSID").Value = iTransId)

lRowCount = lRowCount + 1

builder.InsertCell()

builder.RowFormat.HeadingFormat = False

builder.Font.Bold = False

builder.Font.Size = 12

builder.RowFormat.Alignment = Aspose.Words.Tables.RowAlignment.Left

builder.ParagraphFormat.Alignment = Aspose.Words.ParagraphAlignment.Left

builder.CellFormat.Shading.BackgroundPatternColor = Drawing.Color.White

builder.CellFormat.Width = 180

If Not (IsDBNull(rsOperationLLo.Fields.Item("V_TRANS_PREVIOUS_VALUE").Value)) Then

builder.Write(rsOperationLLo.Fields.Item("V_OPERATION_MODE").Value)

End If

builder.InsertCell()

builder.CellFormat.Width = 72

If Not (IsDBNull(rsOperationLLo.Fields.Item("V_TRANS_PREVIOUS_VALUE").Value)) Then

builder.Write(rsOperationLLo.Fields.Item("V_TRANS_PREVIOUS_VALUE").Value)

End If

builder.InsertCell()

builder.CellFormat.Width = 72

If Not (IsDBNull(rsOperationLLo.Fields.Item("V_TRANS_NEW_VALUE").Value)) Then

builder.Write(rsOperationLLo.Fields.Item("V_TRANS_NEW_VALUE").Value)

End If

builder.RowFormat.AllowAutoFit = True

builder.EndRow()

rsOperationLLo.MoveNext()

If rsOperationLLo.EOF Then Exit Do

<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />Loop

This question was previously asked by many people, but unfortunately there was no solution for this problem. I referred to this link

Please let know if there is anyway to set the cells resize to autofit to the text?

Hi

Thanks for your request. Unfortunately, currently there is no way to set Auto-fit to Content” option using Aspose.Words. We plan to support this in the one of future releases. Your request has been linked to the appropriate issue. You will be notified as soon as it is resolved.

Best regards,

The issues you have found earlier (filed as WORDSNET-2044) have been fixed in this .NET update and in this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(68)