Reporting Services 图形/图表无法显示的解决方法

本文聚焦Reporting Services开发,针对其图形/图表无法显示的'rsStreamNotFound'问题展开分析。介绍了请求报表的流程,指出在本机通过IP访问时图表显示红叉的问题。经分析发现与服务器名中的下划线及会话、cookie有关,给出了更新配置表中UseSessionCookies字段为'False'的解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Reporting Services提供了非常丰富的接口和扩展,给开发人员以极大的施展空间.

期间却也常有些莫名其妙的问题,今天就来搞定这臭名昭著的"图形/图表无法显示的'rsStreamNotFound'":

流程:

Reporting Services产生的是PNG图片.当IE Client请求报表时,

1)创建Session, 
2)返回HTML
3)根据HTML,在该Session内创建新请求,已请求后续的流. (Render报表时,一定要测试RenderStream为空方可中止).

问题:

1)在本机通过 localhost , machine name 访问正常
2)在网络内通过 IP访问正常.
3)在本机通过IP访问,图表显示红叉

解决方案:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=114614&SiteID=1
I discovered that images in report rendering rely on session and cookies.
When you have and underscore "_" in the server name, this may cause some session problems.

So I update the field UseSessionCookies to 'False' in the ConfigurationInfo table, in the RS Database. The images are now displayed!

即:

UseSessionCookiesIndicates whether the report server should use session cookies when communicating with client browsers. The default value is true.

   ReportServices rs=new ReportServices();
   rs.InitReport(strUser,strPassword,strDomain);

   Property setProp = new Property();
   setProp.Name = "UseSessionCookies";
   setProp.Value = null;
   Property[] props = new Property[1];
   props[0] = setProp;

   props=rs.rs.GetSystemProperties(props);
  if(props.Length>0 && props[0].Value.Equals("true"))
   {
    props[0].Value="false";
    rs.rs.SetSystemProperties(props);
   }
   return rs;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值