彩票走势图

彩票走势图 > 慧问 > 频道

Spire.XLS 12.1 支持为单元格设置 Html 字符串吗?

发表于2022-01-25 回复:0 查看:2706  |  

Spire.XLS 12.1 支持为单元格设置 Html 字符串!

Spire.XLS 12.1已发布。该版本支持为单元格设置Html字符串、为现有数据透视表添加条件格式,还支持向IsPasswordProtected()添加文件流、获取 IPrstGeomShape 的链接单元名称,并且还支持计算单个工作表或单元格范围。此外还增强了Excel到PDF,Excel到HTML,Excel到ODF以及HTML到Excel的转换功能,并且修复了图表保存到图片后内容不正确等已知问题。

支持为单元格设置 Html 字符串

Workbook workbook = new Workbook();
workbook.LoadFromFile(@"input.xlsx");
Worksheet sheet = workbook.Worksheets[0];
sheet.Range["A1"].HtmlString = "<div>xxxx<br>yyyy</div>";

支持为现有数据透视表添加条件格式

Workbook workbook = new Workbook();
workbook.LoadFromFile(@"input.xlsx");
Worksheet worksheet = workbook.Worksheets[0];
PivotTable table = worksheet.PivotTables[0] as PivotTable;
PivotConditionalFormatCollection pcfs = table.PivotConditionalFormats;
PivotConditionalFormat pc = pcfs.AddPivotConditionalFormat();
IConditionalFormat cf = pc.AddCondition();
cf.FormatType = ConditionalFormatType.ContainsBlanks;
cf.FillPattern = ExcelPatternType.Solid;
cf.BackColor = Color.Red;

支持向 IsPasswordProtected() 添加文件流

bool havepwd = Workbook.IsPasswordProtected(File.OpenRead(inputFile));
var docBytes = File.ReadAllBytes(inputFile);
MemoryStream ms = new MemoryStream(docBytes);
bool havepwd = Workbook.IsPasswordProtected(ms);

支持获取 IPrstGeomShape 的链接单元名称

Workbook book = new Workbook();
book.LoadFromFile("input.xlsx");
Worksheet sheet = book.Worksheets["sheet1"];
PrstGeomShapeCollection prstGeomShapeCollection = sheet.PrstGeomShapes;
IPrstGeomShape shape = prstGeomShapeCollection["a"];
shape.LinkedCell.RangeAddressLocal;

支持计算单个工作表或单元格范围

Workbook workbook = new Workbook();
workbook.LoadFromFile("input.xlsx");
workbook.Worksheets[0].CalculateAllValue();
workbook.Worksheets[0].Range["A1:C3"].CalculateAllValue();
0个回答

打破零回复...

回复

登录 慧都网发表评论

扫码咨询


添加微信 立即咨询

电话咨询

客服热线
023-68661681

TOP