----------------------------------------------------------- New Message on BDOTNET
----------------------------------------------------------- From: pinga Message 7 in Discussion Try to use stringbuilder class instead of String concatenation Regard udayan -----Original Message----- From: smartchips [mailto:[EMAIL PROTECTED] Sent: Thursday, December 22, 2005 3:08 PM To: BDOTNET Subject: Re: displaying html Tags in word New Message on BDOTNET displaying html Tags in word Reply Reply to Sender Recommend Message 6 in Discussion From: smartchips Word recognizes html entities. Check the following example. private string sHTML= String.Empty; private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here if(!IsPostBack) { sHTML = "<HTML><BODY>"; sHTML += "<TABLE id='tblBOM' WIDTH='60%' border='1'>"; sHTML += "<TR style='HEIGHT: 25.25pt'>"; sHTML += "<TD vAlign='bottom' bgColor='#666699'>"; sHTML += "<span><b>Your database values goes here</b></span><br>"; sHTML += "<br><b>This html tag is Not rendered</b>"; sHTML += "</TD></TR>"; sHTML = sHTML + "</TABLE>"; sHTML = sHTML + "</BODY></HTML>"; Response.ContentType = "application/ms-word"; Response.AddHeader("Content-Disposition","attachment;filename=MyNewReport.doc"); this.Context.Response.Write(sHTML); } } Run the above code in a sample.aspx.cs file and see the result. Cheers Raghu View other groups in this category. ----------------------------------------------------------- To stop getting this e-mail, or change how often it arrives, go to your E-mail Settings. http://groups.msn.com/bdotnet/_emailsettings.msnw Need help? If you've forgotten your password, please go to Passport Member Services. http://groups.msn.com/_passportredir.msnw?ppmprop=help For other questions or feedback, go to our Contact Us page. http://groups.msn.com/contact If you do not want to receive future e-mail from this MSN group, or if you received this message by mistake, please click the "Remove" link below. On the pre-addressed e-mail message that opens, simply click "Send". Your e-mail address will be deleted from this group's mailing list. mailto:[EMAIL PROTECTED]
