您能帮我提供报告服务吗 [英] Could you please help me in reporting services

查看:97
本文介绍了您能帮我提供报告服务吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友们,

我正在从具有HTML标记和一行数据的表中检索数据.我使用存储过程将数据检索到报表中.我只想打印报表(SQL SERVER REPORTING SERVICES)中的数据,而不打印HTML标记.但是,我想执行HTML标记.您能在这方面帮助我吗?

如果能告诉我该怎么做,我将不胜感激...

非常感谢.

Hemachandra

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

推荐答案

我以前是通过使用asp:table
完成此操作的
1.将数据检索到< asp:table xmlns:asp =#unknown">控制;

2.输出数据(.doc)函数
受保护的void OutExcel(表dg,字符串名称)
{
//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(<元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 =新的System.IO.StringWriter();
System.Web.UI.HtmlTextWriter oHtmlTextWriter =新的System.Web.UI.HtmlTextWriter(oStringWriter);
dg.RenderControl(oHtmlTextWriter);
Response.Write(oStringWriter.ToString());
Response.End();
}

祝您好运
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


如果要发布html,则需要更改参数

受保护的void OutExcel( Page dg,字符串名称)
{
//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(<元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 =新的System.IO.StringWriter();
System.Web.UI.HtmlTextWriter oHtmlTextWriter =新的System.Web.UI.HtmlTextWriter(oStringWriter);
dg.RenderControl(oHtmlTextWriter);
Response.Write(oStringWriter.ToString());
Response.End();
}
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();
}


这篇关于您能帮我提供报告服务吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆