Hi, I recently switched from generating XLS-files (SaveFormat.Excel97To2003) to XLSX-Files (SaveFormat.Xlsx). One of the issues I encountered while doing so, was that all my inserted Shapes into the Worksheet lost its borders and I can’t manage to make them appear again. Please see the following code samples. This sample works, my TextBox is bordered in red:
Workbook book = new Workbook ();Worksheet sheet = book.Worksheets[0]; Aspose.Cells.Drawing.TextBox t = sheet.Shapes.AddTextBox(1, 0, 1, 0, 200, 200); t.LineFormat.ForeColor = Color .Red; t.LineFormat.Style = MsoLineStyle .Single; t.LineFormat.Weight = 2; book.Save(filename, SaveFormat .Excel97To2003);This sample does not work, the TextBox does not contain a border:
Workbook book = new Workbook ();Worksheet sheet = book.Worksheets[0]; Aspose.Cells.Drawing.TextBox t = sheet.Shapes.AddTextBox(1, 0, 1, 0, 200, 200); t.LineFormat.ForeColor = Color .Red; t.LineFormat.Style = MsoLineStyle .Single; t.LineFormat.Weight = 2; book.Save(filename, SaveFormat .Xlsx);I have the same issue also with other Shapes, so I guess it is an issue with all types of Shapes.
Thank you in advance for looking into this.
Regards,
Florian
Hi Florian, Thanks for reporting this problem. I will look into it and see if there are any additional things you need for Xlsx or not.
Hi Florian, I have set almost all properties for LineFormat , but no avail. So I will report this as a bug. Both output files have been attached.C#
Workbook book = new Workbook();
Worksheet sheet = book.Worksheets[0];
Aspose.Cells.Drawing.TextBox t = sheet.Shapes.AddTextBox(1, 0, 1, 0, 200, 200);
Shape shp = sheet.Shapes[0];
shp.LineFormat.DashStyle = MsoLineDashStyle.Solid;
shp.LineFormat.Style = MsoLineStyle.Single;
shp.LineFormat.ForeColor = Color.Red;
shp.LineFormat.IsVisible = true ;
shp.LineFormat.Weight = 2;
book.Save(“c:\downloads\output.xlsx”, SaveFormat.Xlsx);
book.Save(“c:\downloads\output.xls”, SaveFormat.Excel97To2003);
Hi Florian, This bug has been logged with id: CELLSNET-23524
Hi Florian, We have fixed this issue in Aspose.Cells for .NET 5.2.1.3 .
sgeslin
January 20, 2011, 12:34am
6
Hello Shakeel, Thank you very much for this quick fix - solved my issues! Regards, Florian
The issues you have found earlier (filed as 23524) have been fixed in this update .
This message was posted using Notification2Forum from Downloads module by aspose.notifier .