SpreadJS16存在错误的公式,GcExcel加载提示异常
本帖最后由 Ellia.Duan 于 2023-12-29 10:02 编辑产品:GcExcel .Net
版本:v6.2.2
问题编号:【DOCXLS-9402】
json文件见附件。
GcExcel异常信息:
GrapeCity.Documents.Excel.InvalidFormulaException: The formula in GJ5 is Invalid! at GrapeCity.Documents.Excel.lt.a(String A_0, hr A_1, Boolean A_2, Boolean A_3, Boolean A_4, Boolean A_5, FormulaExpressionType A_6) at GrapeCity.Documents.Excel.lu.va(String A_0, Int32 A_1, hr A_2) at GrapeCity.Documents.Excel.nf.a(aw2 A_0, xi A_1) at GrapeCity.Documents.Excel.nf.a(aw2 A_0, xi A_1, Dictionary`2 A_2, List`1 A_3, Dictionary`2 A_4, List`1 A_5, List`1 A_6, List`1 A_7, List`1 A_8, List`1 A_9, ic A_10, Int32& A_11, mh A_12, IList`1 A_13) at GrapeCity.Documents.Excel.na.a(at9 A_0, xi A_1, Dictionary`2 A_2, List`1 A_3, Dictionary`2 A_4, List`1 A_5, List`1 A_6, List`1 A_7, List`1 A_8, List`1 A_9, Dictionary`2 A_10, mh A_11, IList`1 A_12, Int32 A_13) at GrapeCity.Documents.Excel.na.a(at9 A_0, xi A_1, Dictionary`2 A_2, List`1 A_3, Dictionary`2 A_4, List`1 A_5, List`1 A_6, List`1 A_7, List`1 A_8, List`1 A_9, Dictionary`2 A_10, Int32& A_11, mh A_12, IList`1 A_13) at GrapeCity.Documents.Excel.na.a(at9 A_0, Stream A_1, IList`1 A_2) at GrapeCity.Documents.Excel.Workbook.FromJson(String json, DeserializationOptions deserializationOptions)
您好,您可以试下open()
您好,上述回复是否可以解决您的问题呢?
public Workbook LoadFreestyleReport(string json)
{
var workbook = new GrapeCity.Documents.Excel.Workbook();
workbook.Culture = CultureInfo.GetCultureInfo("zh-CN");
if (String.IsNullOrWhiteSpace(json))
return workbook;
string tempFileName = this.LocalTempFilePath;
try
{
if (!Directory.Exists(LocalTempFilePath))
{
Directory.CreateDirectory(LocalTempFilePath);
}
tempFileName = $"{LocalTempFilePath}{Guid.NewGuid().ToString("N")}.json";
using (StreamWriter sw = new StreamWriter(tempFileName))
{
sw.Write(json);
}
workbook.Open(tempFileName);
try
{
File.Delete(tempFileName);
}
catch (Exception ex)
{
LogHelper.Error(tempFileName, ex);
}
}
catch (Exception ex)
{
LogHelper.Error(json, ex);
throw;
}
return workbook;
}
使用Open方法打开依然提示异常。
GrapeCity.Documents.Excel.InvalidFormulaException: The formula in GJ5 is Invalid!
at GrapeCity.Documents.Excel.lt.a(String A_0, hr A_1, Boolean A_2, Boolean A_3, Boolean A_4, Boolean A_5, FormulaExpressionType A_6)
at GrapeCity.Documents.Excel.lu.va(String A_0, Int32 A_1, hr A_2)
at GrapeCity.Documents.Excel.nf.a(aw2 A_0, xi A_1)
at GrapeCity.Documents.Excel.nf.a(aw2 A_0, xi A_1, Dictionary`2 A_2, List`1 A_3, Dictionary`2 A_4, List`1 A_5, List`1 A_6, List`1 A_7, List`1 A_8, List`1 A_9, ic A_10, Int32& A_11, mh A_12, IList`1 A_13)
at GrapeCity.Documents.Excel.na.a(at9 A_0, xi A_1, Dictionary`2 A_2, List`1 A_3, Dictionary`2 A_4, List`1 A_5, List`1 A_6, List`1 A_7, List`1 A_8, List`1 A_9, Dictionary`2 A_10, mh A_11, IList`1 A_12, Int32 A_13)
at GrapeCity.Documents.Excel.na.a(at9 A_0, xi A_1, Dictionary`2 A_2, List`1 A_3, Dictionary`2 A_4, List`1 A_5, List`1 A_6, List`1 A_7, List`1 A_8, List`1 A_9, Dictionary`2 A_10, Int32& A_11, mh A_12, IList`1 A_13)
at GrapeCity.Documents.Excel.na.a(at9 A_0, Stream A_1, IList`1 A_2)
at GrapeCity.Documents.Excel.Workbook.a(String A_0, DeserializationOptions A_1)
at Beisen.BI.FreestyleReportV2.ServiceImp.Provider.FreestyleReportBookProvider.LoadFreestyleReport(String json)
本帖最后由 Ellia.Duan 于 2023-12-8 09:49 编辑
您好,在v6.2.5版本已复现您的问题。我将深入调研下此问题,待有进展,会及时联系您。
问题编号:DOCXLS-9402
请速回复,该问题已经严重影响我们进度,导致无法上线 本帖最后由 Ellia.Duan 于 2023-12-8 13:03 编辑
您好,控制台是 warning提示,并不影响后面代码的执行,如下图所示:
如果您不想在控制台输出此问题,可以关闭此日志。
java.util.logging.Logger.getLogger("com.grapecity.documents") .setLevel(java.util.logging.Level.OFF);加上这行代码后,结果如下:
我们使用的是.net版本,不是java Ellia.Duan 发表于 2023-12-8 12:32
您好,控制台是 warning提示,并不影响后面代码的执行,如下图所示:
我们使用的是.net版本,不是java 本帖最后由 Ellia.Duan 于 2023-12-8 14:39 编辑
您好,已收到您的产品信息。我们正在调研.net如何关闭日志。
页:
[1]
2