我使用以下 xml 文件并在 Excel 中打开它
the view
@{
Layout = null;
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("Content-Disposition", "attachment; filename=" + "1.xls");
}
<?xml version="1.0"?> <ss:Workbook xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
<ss:Styles>
<ss:Style ss:ID="DateLiteral">
<NumberFormat ss:Format="General Number"/>
</ss:Style>
</ss:Styles>
<ss:Worksheet ss:Name="Sheet1">
<ss:Table>
<ss:Row>
<ss:Cell ss:StyleID="DateLiteral">
<ss:Data ss:Type="Number">123.01</ss:Data>
</ss:Cell>
</ss:Row>
</ss:Table>
</ss:Worksheet> </ss:Workbook>
即使我给出格式编号,格式仍然是通用的。有什么帮助吗?