是否有人知道是否有可能在SpreadsheetLight中检索公式的数值?如果没有,是否可以将OpenXml中的公式读取为数字?
我需要返回cellValue的7.07 (8,1)
public static void TestSlWorkbook()
{
SLDocument sl = new SLDocument();
sl.SetCellValue(1, 1, 1.01);
sl.SetCellValue(2, 1, 1.01);
sl.SetCellValue(3, 1, 1.01);
sl.SetCellValue(4, 1, 1.01);
sl.SetCellValue(5, 1, 1.01);
sl.SetCellValue(6, 1, 1.01);
sl.SetCellValue(7, 1, 1.01);
sl.SetCellValue(8, 1, "=Sum(A1:A7)");
}发布于 2013-12-12 03:31:56
SpreadsheetLight没有计算引擎,因此没有计算单元公式(目前的状态)。您得到的值要么是Excel先前计算的值(这意味着在您需要该值时它可能已经过时),要么是0(因为SpreadsheetLight没有计算引擎,因此它的默认值为0或空字符串)。
披露:我写了SpreadsheetLight。
发布于 2013-12-10 19:21:36
SpreadsheetLight在他们的站点上有相当好的文档(作为chm下载)。它不适合我,所以我将它解压缩并直接访问html文件( chm是一种奇特的zip文件)。
您是否尝试过sl.GetCellValueAsDouble或其他SLDocument方法?
https://stackoverflow.com/questions/20498403
复制相似问题