0

I know this problem has already been discussed before. But in my case its different. Whenever I try to show .rdlc report it gave me an exception. I don't Understand what's the cause. I have tried to change some references in my config file but still not resolved. Am I missing something?

reportViewer1.LocalReport.EnableExternalImages = true;
ReportDataSource rds = new ReportDataSource("DataSet1", dtData);
reportViewer1.ProcessingMode = ProcessingMode.Local;
reportViewer1.LocalReport.DataSources.Add(rds);
reportViewer1.LocalReport.ReportPath = report_Path;

if (multipleDatasetSelected && SubReportSelected)
    reportViewer1.LocalReport.SubreportProcessing += LocalReport_SubreportProcessing;

if (lstParan.Count > 0)
{
   foreach (string key in lstParan.Keys)
   {
      reportViewer1.LocalReport.SetParameters(new ReportParameter(key, lstParan[key]));
    }
}

this.reportViewer1.LocalReport.Refresh(); 

whenever the last line runs this.reportViewer1.LocalReport.Refresh();. I get and exception in report viewer =>

The WebResource.axd handler must be registered in the configuration to process this request.

<!-- Web.Config Configuration File -->

<configuration>
   <system.web>
       <httpHandlers>
           <add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="True" />
       </httpHandlers>
   </system.web>
</configuration>
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The WebResource.axd handler must be registered in the configuration to process this request.

<!-- Web.Config Configuration File -->

<configuration>
   <system.web>
       <httpHandlers>
           <add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="True" />
       </httpHandlers>
   </system.web>
</configuration>

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[InvalidOperationException: The WebResource.axd handler must be registered in the configuration to process this request.

<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <httpHandlers>
            <add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="True" />
        </httpHandlers>
    </system.web>
</configuration>]
   System.Web.Handlers.AssemblyResourceLoader.GetWebResourceUrlInternal(Assembly assembly, String resourceName, Boolean htmlEncoded, Boolean forSubstitution, IScriptManager scriptManager, Boolean enableCdn) +9810367
   System.Web.Handlers.AssemblyResourceLoader.GetWebResourceUrl(Type type, String resourceName, Boolean htmlEncoded, IScriptManager scriptManager, Boolean enableCdn) +201
   System.Web.UI.ClientScriptManager.GetWebResourceUrl(Page owner, Type type, String resourceName, Boolean htmlEncoded, IScriptManager scriptManager, Boolean enableCdn) +102
   System.Web.UI.ClientScriptManager.RenderWebFormsScript(HtmlTextWriter writer) +121
   System.Web.UI.Page.BeginFormRender(HtmlTextWriter writer, String formUniqueID) +984
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +57
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +32
   System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +55
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +67
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +101
   System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +43
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +129
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +14
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +32
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +67
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +101
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +27
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +129
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +14
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +32
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +67
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +101
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +27
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +129
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +14
   System.Web.UI.Page.Render(HtmlTextWriter writer) +30
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +67
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +101
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +27
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1342

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4330.0
  • Did you try to add the ROLE. See : https://stackoverflow.com/questions/2654514/getting-the-webresource-axd-handler-must-be-registered-in-the-configuration-to – jdweng Feb 13 '21 at 22:05
  • i am getting this error on local system project. – Haashim butt Feb 14 '21 at 00:08
  • somehow I solve this issue but now second problem i am facing. RDLC report not loading report data. I can see only controls and except that everything is blank. Report is not refreshing the data :( – Haashim butt Feb 14 '21 at 01:42
  • see the screenshot in the given link https://snipboard.io/vH3a2y.jpg – Haashim butt Feb 14 '21 at 01:46
  • Did you add th report viewer to the form? – jdweng Feb 14 '21 at 12:14
  • Yes. Basically i wasn't showing reports on report viewer before i was sending reports to client reports to download as PDF format. now i want to first show report in report viewer. – Haashim butt Feb 14 '21 at 14:09
  • that's my report viewer form in given screenshot https://snipboard.io/yxziMK.jpg – Haashim butt Feb 14 '21 at 14:12
  • that's my web.config file for report viewer configuration https://snipboard.io/fQ1p5u.jpg – Haashim butt Feb 14 '21 at 14:14
  • Report is fine when its downloaded in PDF Format but whenever I try to show report in report Viewer everything gets blanks even all the controls get disabled. – Haashim butt Feb 14 '21 at 14:16
  • The report viewer is connecting to an HTTP address in the Server Report Manager. You can connect to the URL using a browser and see if you get results. If you open the SQL Report manager there is a link to the URL that you can use to test the RDLC. Then determine if the issue is with configuring the Report Manager or issue is with your code. – jdweng Feb 19 '21 at 16:26
  • i got so many errors when i try to open report viewer see the link https://snipboard.io/pyiRaP.jpg – Haashim butt Feb 22 '21 at 17:36
  • i am not getting anything why i am getting so many errors ??? does these error have to do with my web.config settings for ReportViewerr ?? https://snipboard.io/gxnRdk.jpg – Haashim butt Feb 22 '21 at 17:38
  • Looks like there are a lot of gif, and png files that are not found. Files should be on the localhost. So I would first search for the file with a windows explorer to see if the files are in a different location.I can't tell if the files get generated when you run the report or the files should be generated before the report is generated.I would assume there is a query to the database, the gif/png get generated and the attached to the report. Normally where I start is the RDLC file is text.I open with notepad and find the Command Text. Then run the query in SSMS to see if there is any data. – jdweng Feb 22 '21 at 20:09
  • ok i will try to find these files first then i will update you thanks – Haashim butt Feb 23 '21 at 18:51

0 Answers0