相关疑难解决方法(0)

OpenXML - SpreadsheetReader 在当前上下文中不存在

所以我试图复制这个答案Getting cell-backgroundcolor in Excel with Open XML 2.0

但 VS 抱怨SpreadsheetReader在当前上下文中不存在。我无法解决ctrl+.这个问题。

这是(几乎可以工作)代码:

using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Spreadsheet;
using DocumentFormat.OpenXml;

public static DocumentFormat.OpenXml.Drawing.PatternFill GetCellPatternFill(Cell theCell, SpreadsheetDocument document)
{
    WorkbookStylesPart styles = SpreadsheetReader.GetWorkbookStyles(document);

    int cellStyleIndex;
    if (theCell.StyleIndex == null) // I think (from testing) if the StyleIndex is null
    {                               // then this means use cell style index 0.
        cellStyleIndex = 0;           // However I did not found it in the open xml 
    }                               // specification.
    else
    { …
Run Code Online (Sandbox Code Playgroud)

c# asp.net-mvc openxml

3
推荐指数
1
解决办法
2424
查看次数

标签 统计

asp.net-mvc ×1

c# ×1

openxml ×1