Thursday, November 8, 2012
SSRS Report Viewer Control Broken Image Below Lines - Missing URL parameter: IterationId
This post has moved along with the rest of this blog to WordPress please go to this link here: http://obscureproblemsandgotchas.com/uncategorized/ssrs-report-viewer-control-broken-image/
Subscribe to:
Post Comments (Atom)
I just had the same problem and searched for "ssrs missing image blank.gif" and google redirected me here.
ReplyDeleteThank you for taking the time to post this!
No problem, I just hope there is a more permanent fix down the line with SSRS 2012.
DeleteThanks. The force is strong in this one :)!
ReplyDeleteThanks a lot for this; your information was very helpful in tracking down the same issue I was having. In exchange, let me do you one better: Get rid of the error entirely!
ReplyDeleteFirst, for reference, I'm using 10.0.0.0 of the ReportViewer control (ReportViewer 2010) and Visual Studio 2008 with SQL Server 2008 R2. I have error notification set up (so I receive an e-mail with every unhandled error), and I would receive a notification of this error although the end user would not see the error page, thanks to it being a call to an "image". This actually happens in FireFox, as well, but FireFox does not display the "broken image" icon that Chrome shows. (Other search results claimed this wasn't a problem in IE, so I didn't bother testing there.)
The image in question is somehow related to the "Line" control within SSRS. For whatever reason, ReportViewer will insert a "blank" image after displaying a Line (I assume this is some sort of space or clearing mechanism); it also appears to only be the Line control, as I have encountered it nowhere else. However, as you discovered, the URL used to generate the image is broken within Chrome (and FireFox).
Rather than create an exclusion for this particular error (something I considered doing, as well), I just removed each instance of the "Line" control and, voila, success! The broken icon and the error message both disappear. If you look at the image you posted with the broken icon, you'll see a line right above it; remove this line and you should see the same result.
Sadly, I don't know how to keep the Line control *and* not have the error message. However, you can replicate the emulate by:
-Using borders on the edges of tables and extending the height of the last row
-Creating a TextBox 1px high and giving it a border
So, while this is still a workaround and not a true solution, I feel it's a lot better than excluding error messages (which I always fear will lead to actual errors going unreported.)
Cheers,
Robert
I have the same setup as you.
DeleteYour solution is better than what I did. I introduced the possibility of unforeseen bugs by intercepting every request and searching for that information every time. Since it is for all requests, I am sure there is a negative cost associated with this technique. This is really my last resort kind of thing.
When I get a chance to go back to my reports, I will see if I can fake a line like you suggested, that is a better fix than modifying my whole site to deal with one broken image icon in chrome/firefox.
Thanks for the tips,
Eli
This works! This is my global.asx
ReplyDelete<%@ Application Inherits="Microsoft.ReportingServices.WebServer.Global" Language="C#" %>
void Application_BeginRequest(object sender, EventArgs e)
{
//The following code is a hack for stopping a broken image from magically appearing on SSRS reports in chrome
//where ever a line is used in the report.
Uri u = HttpContext.Current.Request.Url;
//If the request is from a Chrome browser
//AND a report is being generated
//AND there is no QSP entry named "IterationId"
if (HttpContext.Current.Request.Browser.Browser.ToLower().Contains("firefox") && u.AbsolutePath.ToLower().Contains("reserved.reportviewerwebcontrol.axd") && !u.Query.ToLower().Contains("iterationid"))
HttpContext.Current.RewritePath(u.PathAndQuery + "&IterationId=0");
}
...and I DID have to add
to my web.config. SSRS R2 2008
The web.config bit to add is here: http://www.webdeveloper.com/forum/showthread.php?154780-Application_BeginRequest-in-Global.asax-not-working as above
ReplyDeleteSorry I didn't think to add that bit in, I don't work with Casini or IIS Express, as a rule of thumb I only work with IIS directly period. It is for this reason, the express editions don't work like a real environment and leave out all kinds of important stuff as you have seen.
DeleteGood catch though.
The same issue happens in safari browser also.
ReplyDeleteThe fix works if the line drawn is black in color. If the line is white, its missing in the report, but not displaying the broken image.
That's very interesting. My IE 11 users are gettnig stuck with a "Loading.." screen while IE9 and Firefox clients are error free.
ReplyDeleteI didn't realize this was an image request. I can see in my server Event Viewer logs, that the error is related to ReportViewerWebControl.axd and the URL is missing it's parameter IterationId
The IterationId makes me think that sometimes the image is used to create a visual identation that is wider and wider depending on my many levels deep the report rendering is at.. just guessing, as a developer who has done this sort of thing
Well, funny thing is we don't use ReportViewer in an application but rather calling the report just using URL which of course uses the ReportViewer provided by SSRS thus the Global.asmx doesn't have any code behind since it's all dll on the ReportServer bin which we don't have the source code.
ReplyDeleteIs it possible for you to trace all the traffic going back and forth using Fiddler? You might be able to figure more out there. Regarding the Global.asax, the only time that doesn't have an accompanying cs file, from my experience, is when you are working with a legacy Web Site (versus a Web Application) - in which case you can edit this info in the Web Site's settings somewhere (been a while, I don't remember where). If this problem is happening without a website at all, then I would say try figure out a way to intercept the URLs flying back and forth like I mentioned initially. There should be a way to play with this.
DeleteGreat Solution.. Really Helped a lot. Thanks a ton
ReplyDeleteYou are very welcome.
Delete