Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends,

I am retrieving data from a table which has HTML tags and data in one row. I retrieve data into a report by using a Stored Procedure. I want to print just the data in the report(SQL SERVER REPORTING SERVICES), but not the HTML tags. But, I want to execute the HTML tags. Could you please help me in this regard?

I would be grateful to you if can tell me how to do this ...

Thank you so much.

Hemachandra
Posted
Updated 1-Aug-10 17:45pm
v3
Comments
Sandeep Mewara 28-Jul-10 7:48am    
Crystal or SSRS? Version?
hemachandrareddy 1-Aug-10 23:43pm    
sql server reporting services

I used to do this by using asp:table

1.retrieving data to <asp:table xmlns:asp="#unknown"> control;

2. output data(.doc) function
protected void OutExcel(Table dg, string name)
{
// dg.Visible = true;
Response.Clear();
Response.Buffer = true;
Response.Charset = "utf-8";
name = "attachment;filename=" + name;
Response.AppendHeader("Content-Disposition", name);
Response.ContentEncoding = System.Text.Encoding.GetEncoding(65001);
Response.Write("<meta http-equiv=Content-Type content=text/html;charset=UTF-8>");
//Response.ContentType = "application/ms-excel";
Response.ContentType = "application/vnd.word";
dg.EnableViewState = false;
System.IO.StringWriter oStringWriter = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter);
dg.RenderControl(oHtmlTextWriter);
Response.Write(oStringWriter.ToString());
Response.End();
}

Good luck
 
Share this answer
 
v3
Comments
hemachandrareddy 2-Aug-10 0:45am    
Thank you so much for your reply.
Is there any way to post process the html code in reporting services???
means by using user define functions???

Thank you
If you want to post html, you need to change parameter

protected void OutExcel(Page dg, string name)
{
// dg.Visible = true;
Response.Clear();
Response.Buffer = true;
Response.Charset = "utf-8";
name = "attachment;filename=" + name;
Response.AppendHeader("Content-Disposition", name);
Response.ContentEncoding = System.Text.Encoding.GetEncoding(65001);
Response.Write("<meta http-equiv=Content-Type content=text/html;charset=UTF-8>");
//Response.ContentType = "application/ms-excel";
Response.ContentType = "application/vnd.word";
dg.EnableViewState = false;
System.IO.StringWriter oStringWriter = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter);
dg.RenderControl(oHtmlTextWriter);
Response.Write(oStringWriter.ToString());
Response.End();
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900