使用XML导出具有列名的Excel模板[英] Export the Excel Template with column names using XML

本文是小编为大家收集整理的关于使用XML导出具有列名的Excel模板的处理方法,想解了使用XML导出具有列名的Excel模板的问题怎么解决?使用XML导出具有列名的Excel模板问题的解决办法?那么可以参考本文帮助大家快速定位并解决问题。

问题描述

各位开发者,

如何使用 XML 导出带有列的 excel 模板

问候
Aravind G

推荐答案

lblImportError.Text = "";
字符串 strXML;
strXML = "\n";
strXML += "\n";
strXML += "<workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" hold="/>strXML += " xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40">\n";
strXML += "<excelworkbook xmlns="urn:schemas-microsoft-com:office:excel">\n";
strXML += "<activesheet>2\n";
strXML += "\n";
strXML += "<styles>";
strXML += "<style ss:id="Default" ss:name="Normal">\n";
//strXML += "<style ss:id="merge" ss:selection.merge="">";
strXML += "<对齐 ss:vertical="Bottom" ss:horizo​​ntal="Center">\n";
strXML += "<边框>\n";
strXML += "<字体>\n";
//strXML += "<内部>\n";
strXML += "<数字格式>\n";
strXML += "<保护>\n";
strXML += "</style>\n";
strXML += "<style ss:id="Default1">";
strXML += "<interior ss:color="#63D954" ss:pattern="Solid">";
strXML += "</style>";
strXML += "</style></styles>\n";
strXML += "strXML += "\n";
strXML += " <ss:column ss:width="120">";
strXML += "<ss:column ss:width="120">";
strXML += "<行>\n";
strXML += "获取的类型模板";
strXML += "\n";
strXML += "<行>\n";
strXML += "获取的类型代码\n";
strXML += "<cell ss:styleid="Default1">获取的类型名称\n";
strXML += "\n";
strXML += "
\n";
strXML += "\n";
strXML += "";
字符串 ExcelXML = strXML.Replace("''", "\"");
Response.Clear();
Response.AppendHeader("Content-Type", "application/vnd.ms-excel");
Response.AppendHeader("Content-disposition", "attachment; filename=AcquiredType");
Response.Write(ExcelXML);
Response.Flush();
Response.End();

本文地址:https://www.itbaoku.cn/post/1356002.html