我通过Gridview导出文件.XML但元数据显示为 我想要像
这样的元数据这是我的代码
private void ExporttoExcel( DataTable table)
{
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ClearContent();
HttpContext.Current.Response.ClearHeaders();
HttpContext.Current.Response.Buffer = true;
HttpContext.Current.Response.ContentType = "application/xml";
HttpContext.Current.Response.Write(@"<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN"">");
HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename= Att " + txtPeriodeAwal.Text + " to " + txtPeriodeAkhir.Text + ".xml");
HttpContext.Current.Response.Charset = "UTF-8";
HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.UTF8;
HttpContext.Current.Response.Write("<?xml version=\"1.0\"?>");
HttpContext.Current.Response.Write("<?mso-application progid=\"Excel.Sheet\"?>");
HttpContext.Current.Response.Write(" <Workbook xmlns=\"urn:schemas-microsoft-com:office:spreadsheet\"");
HttpContext.Current.Response.Write("xmlns:o=\"urn:schemas-microsoft-com:office:office\"");
HttpContext.Current.Response.Write("xmlns:x=\"urn:schemas-microsoft-com:office:excel\"");
HttpContext.Current.Response.Write("xmlns:ss=\"urn:schemas-microsoft-com:office:spreadsheet\"");
HttpContext.Current.Response.Write("xmlns:html=\"http://www.w3.org/TR/REC-html40\">");
}
我可以在My Code上的元数据上获得新行缩进吗?