LocalReport.Render函数,在ReportViewer 10.0中将ImpersonationLevel更改为None(在9.0中它没有) - 为什么,如何解决这个问题? [英] LocalReport.Render function, changes ImpersonationLevel to None in ReportViewer 10.0 (in 9.0 it does not) - why, how to solve this?

查看:119
本文介绍了LocalReport.Render函数,在ReportViewer 10.0中将ImpersonationLevel更改为None(在9.0中它没有) - 为什么,如何解决这个问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个针对  .net 3.5的ASP.NET应用程序。我们最近切换到VS 2010,我们不得不将对ReportViewer的引用从9.0更改为10.0。令我们惊讶的是,
结果是ReportViewer 10.0中的LocalReport.Render函数正在从"模拟"中更改ImpersonationLevel。到"无"。如果我错了请纠正我,但这必须是一个错误 - 它不能成为一个功能!

让我告诉你如何重现一个问题:

1)创建自己的WebApplication。添加一个  .rdlc文件。

2)在web.config中添加
< 身份
模仿 = " true " />

2) In web.config add <identity impersonate="true"/>

3)尝试使用ReportViewer 9.0和10.0打印.rdlc文件,打印前后检查模拟级别,如下所示:

System.Security.Principal.WindowsIdentity widnowsIdentity = System.Security.Principal.WindowsIdentity.GetCurrent();

      //Render the report
      byte[] renderedBytes = localReport.Render(
        reportType,
        deviceInfo,
        out mimeType,
        out encoding,
        out fileNameExtension,
        out streams,
        out warnings);

      widnowsIdentity = System.Security.Principal.WindowsIdentity.GetCurrent();

4)您会看到: 在引用ReportViewer 9.0后,您会看到打印前后的 ""windowsIdentity.ImpersonationLevel"参数保持不变并等于"模拟"。但是引用了ReportViewer 10.0,您将获得
在打印之前看到参数"windowsIdentity.ImpersonationLevel"等于"模拟"并且在打印之后它等于"无"。

4) What You will see is that: With ReportViewer 9.0 referneced, You will see that "windowsIdentity.ImpersonationLevel" parameter before and after printing stays the same and equals "Impersonation". But with ReportViewer 10.0 referenced, You will see that parameter "windowsIdentity.ImpersonationLevel" before printing equals "Impersonation" and after printing it equals "None".

为什么?和&如何解决此问题  - 除了每次调用LocalReport.Render后再次冒充用户(在代码中)???

WHY? And how to go around this problem - other than impersonating user again (in the code) after every call to LocalReport.Render???

推荐答案

任何想法?


这篇关于LocalReport.Render函数,在ReportViewer 10.0中将ImpersonationLevel更改为None(在9.0中它没有) - 为什么,如何解决这个问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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