The following code correctly sets the “Wrap” property to true but the VerticalAlignment of the cell (when the saved spreadsheet has been opened) is “Center” rather than “Top”:
Amjad Sahi:Hi,I think you may simply use first overloaded version of the method:itemsSheet.Cells[i].SetStyle(cellStyle);instead of:itemsSheet.Cells[i].SetStyle(cellStyle, true);it works fine for your requirement.Thank you.
We have fixed this issue. Please download: Aspose.Cells for .NET v220.127.116.11
The issues you have found earlier (filed as 30651) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.
Seems like the overload version does not work for the latest version of the Aspose.Cells DLL 18.104.22.168
wsheet.Cells[0, 0].SetStyle(Style.Font.IsBold, true);
This line of code gives an error, eventhoug I am using the latest version of Aspose.Cells.
Thanks for your posting and using Aspose.Cells for .NET.
Please download and try the latest version:
for .NET v22.214.171.124
Please see the following code that illustrates how to use the Cell.SetStyle(Style style, bool explicitFlag) method for your needs.
I have also attached the source and output xlsx files generated by the code and screenshot for your reference.
string filePath = @“F:\Shak-Data-RW\Downloads\source.xlsx”;
Workbook workbook = new Workbook(filePath);
Worksheet worksheet = workbook.Worksheets;
Cell cell = worksheet.Cells[“A1”];
Style style = workbook.CreateStyle();
style.Font.IsBold = true;
workbook.Save(filePath + “.out.xlsx”, SaveFormat.Xlsx);