.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Handling Errors displayed in the ReportViewer control

Posted By:      Posted Date: September 23, 2010    Points: 0   Category :Sql Server

Hi, this kind of a two part question.  Is there any way to handle an error that is displayed inside a report, such as an error returned from a stored procedure?  I have a page with the ReportViewer control on it, but I don't really have any control over the rdl's or the sprocs, so it's possible that something will go wrong.  Currently I'm just getting the following error:

  • An error has occurred during report processing.
    • Query execution failed for dataset 'XXXX'.
      • For more information about this error navigate to the report server on the local server machine, or enable remote errors

If at all possible I would like to handle this error myself and show a message that's consistent with the rest of the site.  I've attempted to handle the ReportError event, but this seems to only fire when there's an issue with the viewer itself, not what it's showing.

View Complete Post

More Related Resource Links

(Microsoft.Reporting.WebForms.ReportViewer) is not compatible with the type of control (Microsoft.Re


 I am trying to use ReportViewer 9 in Visual Studio 8 but I get this error when I try to run the page:

The base class includes the field 'ReportViewer1', but its type (Microsoft.Reporting.WebForms.ReportViewer) is not compatible with the type of control (Microsoft.Reporting.WebForms.ReportViewer).

Please help if you can!


ReportViewer DatePicker Parameter - calendar not displayed when clicked

Hi, I'm using VS2008 ReportViewer control and one of my reports in SSRS 2008 R2 has a DateTime parameter. I can enter the date into the textbox and view report successfully. However the calendar is not showing when I click the calendar icon. (Note: I encounter NO error).  It seems that it's a known issue in Visual Studio. Anyone knows any workaround/hack to fix this issue? Thanks in Advance, Raymond

Does the ReportViewer control print button work inside of a modal MSIE window?

I am getting the following two error messages when using the new ReportViewer v10 control after pressing the toolbar print button. I am only seeing this error inside of a modal popup window in MSIE. The print button in a normal popup window doesn't have this error. An error occurred trying to get the current window Error: Could not complete the operation due to error 8007f305. If anyone knows of a quick fix, please let me know. Thank you. VS2010, MSIE 8, SQL Server 2008.

A reportviewer control bug to display unicode?

  1 Hello everyone, I am using VSTS 2008 + C# + .Net 3.5 + ASP.Net + IIS 7.0 with reportviewer control. The report created by reportviewer control is very simple, just a single line of Chinese characters (I wrote the line of characters statically in a textbox control, no addtional dynamically generating or fetching from database). I upload the error PDF file exported by the report viewer and screen snapshot here, and my most confusion is why the exported PDF file is just 2k bytes size? Is this issue caused by font not embedded in PDF file? Actually I did not find how to embed font in PDF file. Appreciate if anyone could give me some good ideas. This is the error PDF displayed screen snapshot, http://www.4shared.com/photo/gs_KvxSW/characterissue.html This is the error PDF itself, http://www.4shared.com/document/4Fs5rCH_/characterissue.html thanks in advance, George

Handling Ctrl + Shift + Click on Button control

Hi All, I have to Button control in my Windows form. I have to handle 2 types of click events on this button. 1. Ctrl + Shift + Click //Allow the user to do some special task. 2. Click //Allow the user to perform normal task only. How could I handle Ctrl + Shift + Click ? Please help me out.

Client Javascript runs, but then page errors out when clicking on a control that uses postback

Using this script on a button click <script language="javascript"> function printdiv(printpage) { var headstr = "<html><head><title></title></head><body>"; var footstr = "</body>"; var newstr = document.all.item(printpage).innerHTML; var oldstr = document.body.innerHTML; document.body.innerHTML = headstr + newstr + footstr; window.print(); document.body.innerHTML = oldstr; return false; } </script> After it is done, I can't click on my calendar control.  I was hoping to add somethign that would force a refresh in the script, but nothing I do works. Any thoughts?  Thanks! 

how to apply styles on the message displayed by asp.net required field validator control?

 Hi,I want to apply styles on the message (i.e. Name field is required) display by the asp.net required field validator control.Styles=border, padding, background-color, font-color, font-weight, img etcAnd I also want highlight the border or asp.net textbox and asp.net dropdown list with which this control is associated.  RequiredFieldValidator does not have style property !Can anyone let me know how can I do this???Regards,Dazy

WPF- Back/Forward navigation UI not working when Html web files are displayed in Frame Control


I am integrating (web) html files in my WPF application using Frame (say Source=http://www.microsoft.com)

I set the JournalOwnership="OwnsJournal" and


The navigation UI is visible and disabled initially when the page loads up (which is fine), but when I click on links the Back/Forward button is not enabled.  Interestingly the context menu shows Back/Forward and I can navigate that way. Do you have pointers?


Thanks for your help.

Graphs are not being displayed in ReportViewer after upgrade to SQL Server 2008 R2


I am having a problem with my graphs disappearing after upgrading to Reporting Services 2008 R2.  The graphs are visible if the report is run from the Report Mananger but if the report is viewed from an ASP web app using ReportViewer 9.0 they disappear.  If the report is exported the graphs are there.  This is driving me crazy.

My Report Viewer code from the web page:



and web config http handler:




HELP!!!  Does anyone have any ideas?  I saw the post about u

Error handling: writing database errors to a table that will not get removed by a rollback


I have an error handler sproc that issues a RAISERROR statement.  I would like for this sproc to write error messages to a table.  No problem so far.  What if there is a nested transaction with several ROLLBACKs?  If the code is only 1 level deep the error handler sproc can write to the error message table after the ROLLBACK.  If the code is 2 or more levels deep and an error occurs then what is written to the error message table might get rolled back if an error occurs after returning to the 1st level.  What I thought I would like to do is to have the error handler spawn a sub-process that would record the error message, where the sub-process would not be affected by any subsequent ROLLBACKs in the calling sproc.  Thoughts?

Handling control events in MVVM



I'm using MVVM and works fine untill I have to handle event's of different controls on my view. I have a textbox and need to pass the value of text once typying in completed , to the view model. Is there a way to do this similar to the way the routed commands are handled. Appreciate any advice.



Error When a Word Document is displayed in WebBrowser Control



We are using a WebBrowser control to display an MS Word document in a form. This was working fine for a long time, and now we tried to install this application in a new server. Now we are facing an issue. When we try to open the word document by using WebBrowserControl.Navigate method, it is asking the Open/Save dialog box, which is typically displayed when we download a file. Then if the user clicks on Open button, we are getting an error "Windows cannot find 'UsersTempFolder\1\Temp\MyDoc.DOCX'. Make sure you typed the name correctly, and then try again. To search for a file, click the Start button, and then click Search.". Please note that UsersTempFolder\1\Temp\MyDoc.DOCX is NOT the path I have given in Navigate method. Also, if I click Save in open/save dialog box, I can save to a location and open it.

I don't have direct access to this server, but if I can believe the words of support person, every configuration is set same as our old server. Here is the details.

.NET Framework 3.0

MS Office 2003

Internet Explorer 6 SP2.

Could any one please help me to solve this issue? Any help is very much appreciated. Please let me know if you need any other details.



handling html server control events


How to wire up HTML server controls events?

I added a Input (Text) control in my web form and turned it into an HTML server control so its an instance of HtmlInputText class.

If I double click on the control It only adds a OnClick event handler method inside the script tags in the HTML doc of the web form but how to I get to handle its Serverchange event exactly? does VS.net 2008 has no ability to auto wire up the event to the control, do I have to manually wire up the event handler?

AJAX on my page causes errors with my control


 I have been playing with ajax latley and trying to implement it on a site I have been developing. I can throw the proper tags around my entire container for the page and everything works great...except that I have a button on page that allows users to download a csv with the profile information for user beeing viewed. This button will not work with the ajax.


    <asp:ScriptManager EnablePartialRendering="true"
 ID="ScriptManager1" runat="server"></asp:ScriptManager>

 <asp:UpdatePanel ID="UpdatePanel1" runat="server">

html goes here......


I have tried putting the tags inside individual columns but the controls work with other controls in different columns.
eg. Search for users.. gridview displays users.. when user is selected from gridview a multiview on right side of page loads a view displaying the users profile info as well as buttons for editing deleting emailing the user.. also the export contact info to a csv file. I need the postback to happen when the email and export buttons are clicked.. the update btn works fine, and I am not online so I cannot tell for sure of the email works. But I am certain the export b

Help printing .rdl reports using the asp ReportViewer control from a web page to the users client pr


I have developed a set of ssrs .rdl reports and am trying to display them from the reportviewer control embeded in my asp web page. The problem is that when I select the print icon on the reportviewer control I am prompted to install ms sql server. I need help here. What is the best way to print .rdl reports from the web page's embeded reportviewer control to the client's local network printer.





Add ReportViewer httphandler and entire website errors


I have a site thats working fine - I added a page with a reportviewer control and get the error message

The Report Viewer Web Control HTTP Handler has not been registered in the application's web.config file.  Add <add verb="*" path="Reserved.ReportViewerWebControl.axd" type = "Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> to the system.web/httpHandlers section of the web.config file.

I added this to the system.web section of web.config, and when I do - the entire site no longer works, I get a "500 - Internal server error." 

The web.config currently reads:

<?xml version="1.0"?>
		<add connectionString="Server=server;
         User ID=user;
         Password= password" 

ReportViewer Control large dataset timeout


Reporting Services 2008 R2

I have a rather large report that returns around 40,000 records. (I've tried telling the business that this is not a useable report and no one is listening.)

When I execute the report through a webservice and stream it to an excel file the response time is fine.  Trying to load the report using the report viewer control it just hangs.

When I run the report through SSRS own Report Manager, I get the following error

  • An error occurred within the report server database. This may be due to a connection failure, timeout or low disk condition within the database. (rsReportServerDatabaseError)
    • Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.



This is on my own local dev machine at the minute and I've only just gotten the correct dataset it will be run against.

The stored proc runs in a couple of seconds.

Does anybody have any suggestions in what I can do?

Any help would be appreciated.



-----  Code

<rsweb:ReportViewer ID="WebRep

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend