• <menu id="w2i4a"></menu>
  • 首頁 > 慧問 > 頻道

    Spire.XLS 12.1 支持為單元格設置 Html 字符串嗎?

    發(fā)表于2022-01-25 回復:0 查看:2520  |  

    Spire.XLS 12.1 支持為單元格設置 Html 字符串!

    Spire.XLS 12.1已發(fā)布。該版本支持為單元格設置Html字符串、為現(xiàn)有數(shù)據(jù)透視表添加條件格式,還支持向IsPasswordProtected()添加文件流、獲取 IPrstGeomShape 的鏈接單元名稱,并且還支持計算單個工作表或單元格范圍。此外還增強了Excel到PDF,Excel到HTML,Excel到ODF以及HTML到Excel的轉換功能,并且修復了圖表保存到圖片后內(nèi)容不正確等已知問題。

    支持為單元格設置 Html 字符串

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

    支持為現(xiàn)有數(shù)據(jù)透視表添加條件格式

    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個回答

    打破零回復...

    回復

    登錄 慧都網(wǎng)發(fā)表評論

    掃碼咨詢


    添加微信 立即咨詢

    電話咨詢

    客服熱線
    023-68661681

    TOP
    三级成人熟女影院,欧美午夜成人精品视频,亚洲国产成人乱色在线观看,色中色成人论坛 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();