Using XMLTextWriter
-
Hi guys, Am trying to export some data to Excel file I can succeed in exporting the data but i couldnt format the headers and data.For example,
<Font ss:Bold="1"/> <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
if i want to include this formatting using XMLTextWriter, how can i do that? Am using the following code to export the data:for(int j=0;j<xHeader.Length;j++)//for Headers { writer.WriteString("\""); writer.WriteStartElement("xsl:value-of"); writer.WriteAttributeString("select", "'" + xHeader[j] + "'"); writer.WriteEndElement(); // xsl:value-of writer.WriteString("\""); if (j != xFields.Length - 1) writer.WriteString(" "); }
I need to format this xHeader's value to be formatted as "Bold" while opening as Excel. Please help me! -
Hi guys, Am trying to export some data to Excel file I can succeed in exporting the data but i couldnt format the headers and data.For example,
<Font ss:Bold="1"/> <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
if i want to include this formatting using XMLTextWriter, how can i do that? Am using the following code to export the data:for(int j=0;j<xHeader.Length;j++)//for Headers { writer.WriteString("\""); writer.WriteStartElement("xsl:value-of"); writer.WriteAttributeString("select", "'" + xHeader[j] + "'"); writer.WriteEndElement(); // xsl:value-of writer.WriteString("\""); if (j != xFields.Length - 1) writer.WriteString(" "); }
I need to format this xHeader's value to be formatted as "Bold" while opening as Excel. Please help me!It seems that you are writing Xml file rather than Excel file
Thanks and Regards Sandeep