Monday, April 6, 2009

Report Viewer 404 Error In Asp.Net Application IIS-7.0 and Sql Server 2008-- File or directory not found

we had to face this problem while we were trying to show reprot in asp.net page with report viewer. Our website was hosted on windows 2008 server and we used Sql Server 2008 reporting service.

To overcome the issue we followed the steps described below.

1.Open IIS Manager
2.double-click on Handler Mappings icon.
3.At the Action pane on your right, click on Add Managed Handler.
4.At the Add Managed Handler dialog, enter the following: Request path: Reserved.ReportViewerWebControl.axd Type: Microsoft.Reporting.WebForms.HttpHandler
Name: Reserved-ReportViewerWebControl-axd Click OK.

Then add the following lines of code in your web config file in the section.

<add name="Reserved-ReportViewerWebControl-axd" path="Reserved.ReportViewerWebControl.axd" verb="*"
type="Microsoft.Reporting.WebForms.HttpHandler" resourceType="Unspecified"/>

Fix 401 error while accessing sql server reporting service with c# code

While working with reporting service in our last project we had to face 401 issue while accessing reporting service from remote computer(using .net code).After lot of digging in the net i found the following solution which worked for me on both windows server 2003 and server 2008.
  1. Click Start, click Run, type regedit, and then click OK.
  2. In Registry Editor, locate and then click the following registry key:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
  3. Right-click Lsa, point to New, and then click DWORD Value.
  4. Type DisableLoopbackCheck, and then press ENTER.
  5. Right-click DisableLoopbackCheck, and then click Modify.
  6. In the Value data box, type 1, and then click OK.
  7. Quit Registry Editor, and then restart your computer.