Aspose公司对旗下Excel文档处理产品
Aspose.Cells for .NET发布了新的16.10版本,在这个版本该产品增加了几个新的功能,并对以往版本存在的部份BUG进行了修复,具体可以参考下面的详细信息:
1.在新的版本中支持为Excel中插入的图形对象设置倒影效果
//Load your source excel file
Workbook wb = new Workbook("sample.xlsx");
//Access first worksheet
Worksheet ws = wb.Worksheets[0];
//Access first shape
Shape sh = ws.Shapes[0];
//Set the reflection effect of the shape
//Set its Blur, Size, Transparency and Distance properties
ReflectionEffect re = sh.Reflection;
re.Blur = 30;
re.Size = 90;
re.Transparency = 0;
re.Distance = 80;
//Save the workbook in xlsx format
wb.Save("output.xlsx");
2.支持为插入的图形对象设置阴影效果
//Load your source excel file
Workbook wb = new Workbook("sample.xlsx");
//Access first worksheet
Worksheet ws = wb.Worksheets[0];
//Access first shape
Shape sh = ws.Shapes[0];
//Set the shadow effect of the shape
//Set its Angle, Blur, Distance and Transparency properties
ShadowEffect se = sh.ShadowEffect;
se.Angle = 150;
se.Blur = 4;
se.Distance = 45;
se.Transparency = 0.3;
//Save the workbook in xlsx format
wb.Save("output.xlsx");
3.支持为插入的图形对象设置发光效果
//Load your source excel file
Workbook wb = new Workbook("sample.xlsx");
//Access first worksheet
Worksheet ws = wb.Worksheets[0];
//Access first shape
Shape sh = ws.Shapes[0];
//Set the glow effect of the shape
//Set its Size and Transparency properties
GlowEffect ge = sh.Glow;
ge.Size = 30;
ge.Transparency = 0.4;
//Save the workbook in xlsx format
wb.Save("output.xlsx");
4.支持为插入的图形对象设置3维格式
//Load excel file containing a shape
Workbook wb = new Workbook("sample.xlsx");
//Access first worksheet
Worksheet ws = wb.Worksheets[0];
//Access first shape
Shape sh = ws.Shapes[0];
//Apply different three dimensional settings
ThreeDFormat n3df = sh.ThreeDFormat;
n3df.ContourWidth = 17;
n3df.ExtrusionHeight = 32;
//Save the output excel file in xlsx format
wb.Save("output.xlsx");
5.支持为图形对象设置艺术文字内嵌样式
//Create workbook object
Workbook wb = new Workbook();
//Access first worksheet
Worksheet ws = wb.Worksheets[0];
//Add Word Art Text with Built-in Styles
ws.Shapes.AddWordArt(PresetWordArtStyle.WordArtStyle1, "Aspose File Format APIs", 00, 0, 0, 0, 100, 800);
ws.Shapes.AddWordArt(PresetWordArtStyle.WordArtStyle2, "Aspose File Format APIs", 10, 0, 0, 0, 100, 800);
ws.Shapes.AddWordArt(PresetWordArtStyle.WordArtStyle3, "Aspose File Format APIs", 20, 0, 0, 0, 100, 800);
ws.Shapes.AddWordArt(PresetWordArtStyle.WordArtStyle4, "Aspose File Format APIs", 30, 0, 0, 0, 100, 800);
ws.Shapes.AddWordArt(PresetWordArtStyle.WordArtStyle5, "Aspose File Format APIs", 40, 0, 0, 0, 100, 800);
//Save the workbook in xlsx format
wb.Save("output.xlsx");
6.支持在ListObject中自动传播公式
//Create workbook object
Workbook book = new Workbook();
//Access first worksheet
Worksheet sheet = book.Worksheets[0];
//Add column headings in cell A1 and B1
sheet.Cells[0, 0].PutValue("Column A");
sheet.Cells[0, 1].PutValue("Column B");
//Add list object, set its name and style
ListObject listObject = sheet.ListObjects[sheet.ListObjects.Add(0, 0, 1, sheet.Cells.MaxColumn, true)];
listObject.TableStyleType = TableStyleType.TableStyleMedium2;
listObject.DisplayName = "Table";
//Set the formula of second column so that it propagates to new rows automatically while entering data
listObject.ListColumns[1].Formula = "=[Column A] + 1";
//Save the workbook in xlsx format
book.Save("output.xlsx");
另外在新的版本还支持:
- 检测工作表内是否有额外的链接
- 支持添加XML地图到工作表中,并且可以连接单元格到地图元素
- 支持为图形对象的文本设置艺术文字
- 支持从客户端读取GridWeb单元格中的值
- 支持在GridWeb中自定义计算公式
- 在新的版本中对公式计算引擎进行了增强
-