ReportViewer “Missing URL parameter: Name”

无人久伴 提交于 2019-12-05 12:39:30

Sounds like something is mangling your URL somewhere. Do you by chance have a Bluecoat proxy in place? I saw something about Bluecoat mangling the URL.

If that's the case and you have control over the proxy, you might be able to get a tunnel punched through it for your reports. Otherwise, you might have to rewrite the URL on your end.

Check here for more information (last post in the thread has a possible workaround).

You can fix this globally by checking for the BlueCoat request header at the start of each request. This bit of code placed in global.asax.cs fixes the problem:

protected void Application_BeginRequest(Object sender, EventArgs e) 
{
    // Fix incorrect URL encoding by buggy BlueCoat proxy servers:
    if (!String.IsNullOrEmpty(Request.ServerVariables["HTTP_X_BLUECOAT_VIA"]))
    {
        string original = Request.QueryString.ToString();

        if (original.Contains(Server.UrlEncode("amp;"))) 
        {
            HttpContext.Current.RewritePath(Request.Path + "?" + original.Replace(Server.UrlEncode("amp;"), "&"));
        }
    }
}

I'm not sure if any other proxy servers have the same issue, but if they do, this could be easily be adapted to check for the presence of & in the QueryString instead of checking for the BlueCoat header (or I guess, you could just check for the headers of any other affected products, which might be safer.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!