Hi,
I convert a dataSet to rtf with this code:
ds = createDataSet();
XmlDataDocument xmlDoc2 = new XmlDataDocument(ds);
XslTransform xslTran = new XslTransform();
xslTran.Load(Server.MapPath("rtf.xslt"));
Response.ContentType = "application/msword";
Response.Charset = "";
Response.ContentEncoding = System.Text.Encoding.Default;
Response.AddHeader("Content-Disposition", "inline;filename="+strTmp+".rtf");
xslTran.Transform(xmlDoc2, null, Response.Output, null);
The stylesheet looks like this:
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform">
<xsl

utput method="text"/>
<xsl:template match="/">
<xsl:text>{\rtf1 \f4\fs18</xsl:text
<xsl:text>{\colortbl;\red255\green255\blue255;\red0\green0\blue255;}</xsl:text>
<xsl:for-each select="NewDataSet/tblUserData">
<xsl:text>\b </xsl:text>
<xsl:value-of select="User_Name"/>
<xsl:text>\b0 </xsl:text>
<xsl:text>\par </xsl:text>
<xsl:value-of select="User_Position"/>
<xsl:text>\par </xsl:text>
<xsl:value-of select="User_Department" />
<xsl:text>\par </xsl:text>
<xsl:value-of select="User_Phone"/>
<xsl:text>\par </xsl:text>
<xsl:value-of select="User_Fax"/>
</xsl:for-each>
<xsl:text>}</xsl:text>
</xsl:template>
</xsl:stylesheet>
it works fine exept it writes the HTML (aspx file) code from the webpage
into the stylesheet. Is there a way to prevent this from happening?
Thanks for your help
Chris