我使用此代码片段从数据集创建一个 excel 表(我解析 .rtf 文件并获取数据集列表)。但是我的代码片段的第 3 行出现错误
错误:找不到类型或命名空间名称“WorkbookEngine”(您是否缺少 using 指令或程序集引用?)
XmlDataDocument xmlDataDoc = new XmlDataDocument(DS);
XslCompiledTransform xt = new XslCompiledTransform();
StreamReader reader = new StreamReader(typeof(WorkbookEngine).Assembly.GetManifestResourceStream(typeof(WorkbookEngine), "ValidationReport1.xls"));
XmlTextReader xRdr = new XmlTextReader(reader);
xt.Load(xRdr, null, null);
StringWriter sw = new StringWriter();
xt.Transform(xmlDataDoc, null, sw, null);
StreamWriter myWriter = new StreamWriter(System.Windows.Forms.Application.StartupPath + "\\Reports\\ValidationReport1.xls");
myWriter.Write(sw.ToString());
myWriter.Close();