This is a migrated thread and some comments may be shown as answers.

Works in VS and not in IIS 7

3 Answers 473 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 17 Jun 2009, 08:29 PM
I have a reportviewer that displays some reports on an .aspx page. When I serve these pages with Visual Studio everything runs as it should. Report displays on the page fine.
  However, when I go to serve the pages with IIS 7, I get the following error : "Cannot create an object of type 'Telerik.Reporting.IReportDocument' from its string representation 'ReportingLib.Sales, ReportingLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' for the 'Report' property". "ReportingLib" is the class library where my reports exist. Following info seems to be relevant here.  
1)I have all of the telerik trial version dlls installed in the gac on the machine as well as in the web applications bin directory. 2) On the page with the report viewer I have the below code. Also below is my web.config. Note I have placed httphandler sections with relevant info in both the <system.web> and <system.webserver> sections of the web.config(as given in a previous post on the forum).  I have tinkered with my web.config settings quite a bit believing this maybe where the issue is. If I eliminate the <validation  validateIntegratedModeConfiguration="false"> for the <system.webServer> node IIS7 comes back with an error 

HTTP Error 500.23 - Internal Server Error

An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.

Can anyone tell me is there something i need to tell iis7 in my web.config or is there a better way to troubleshoot this?

Jason

<?

 

xml version="1.0"?>

 

<!--

 

 

Note: As an alternative to hand editing this file you can use the

web admin tool to configure settings for your application. Use

the Website->Asp.Net Configuration option in Visual Studio.

A full list of settings and comments can be found in

machine.config.comments usually located in

\Windows\Microsoft.Net\Framework\v2.x\Config

-->

<

 

configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

 

<

 

appSettings/>

 

<

 

connectionStrings>

 

<

 

remove name="LocalSqlServer"/>

 

<

 

add name="connSomsys" connectionString="Data Source=CMDIVST004\JASON08;Initial Catalog=QuoteDB;Persist Security Info=True;User ID=ggggg;Password=ggggg" providerName="System.Data.SqlClient"/>

 

</

 

connectionStrings>

 

<!--

 

<compilation debug="false" />

 

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">

<error statusCode="403" redirect="NoAccess.htm" />

<error statusCode="404" redirect="FileNotFound.htm" />

</customErrors>

 

 

-->

 

<

 

system.web>

 

<

 

httpHandlers>

 

<

 

add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" validate="false"/>

 

<

 

add path="Telerik.ReportViewer.axd" verb="*" type="Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=3.0.9.430, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" validate="true"/>

 

</

 

httpHandlers>

 

<

 

httpRuntime maxRequestLength="512000"/>

 

<

 

compilation defaultLanguage="c#">

 

<

 

assemblies>

 

<

 

add assembly="MonoSoftware.Web.TextBox, Version=1.0.0.0, Culture=neutral, PublicKeyToken=FAF3283597AC56FF"/>

 

<

 

add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

 

<

 

add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

 

<

 

add assembly="Xheo.Licensing, Version=2.1.5000.0, Culture=neutral, PublicKeyToken=798276055709C98A"/>

 

<

 

add assembly="MonoSoftware.Web.DynamicPopUp, Version=1.5.0.0, Culture=neutral, PublicKeyToken=FAF3283597AC56FF"/>

 

<

 

add assembly="MonoSoftware.Web.Helper, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=FAF3283597AC56FF"/>

 

<

 

add assembly="System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

 

<

 

add assembly="System.Web, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

 

<

 

add assembly="MonoSoftware.Web.Calculator, Version=1.0.0.0, Culture=neutral, PublicKeyToken=FAF3283597AC56FF"/>

 

<

 

add assembly="Office, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"/>

 

<

 

add assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

 

<

 

add assembly="Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

 

<

 

add assembly="Telerik.ReportViewer.WebForms, Version=3.0.9.430, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE"/>

 

<

 

add assembly="Telerik.Reporting.Processing, Version=3.0.9.430, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE"/>

 

<

 

add assembly="Telerik.Reporting, Version=3.0.9.430, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE"/>

 

<

 

add assembly="Telerik.Reporting.Interfaces, Version=3.0.9.430, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE"/>

 

<

 

add assembly="Telerik.Reporting.HtmlEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"/>

 

<

 

add assembly="Telerik.Reporting.Design, Version=3.0.9.430, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE"/>

 

<

 

add assembly="Telerik.ReportViewer.Design, Version=3.0.9.430, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE"/>

 

<

 

add assembly="Telerik.ReportViewer.WinForms, Version=3.0.9.430, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE"/>

 

<

 

add assembly="ReportingLib, Version=1.0.0.0, Culture=neutral"/>

 

</

 

assemblies>

 

<

 

buildProviders>

 

<

 

add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

 

</

 

buildProviders>

 

</

 

compilation>

 

<

 

sessionState timeout="45"/>

 

<

 

authentication mode="Forms">

 

<

 

forms timeout="300"/>

 

</

 

authentication>

 

<

 

authorization>

 

<

 

deny users="?"/>

 

</

 

authorization>

 

</

 

system.web>

 

<!--

 

allow users to access these directories/pages/files without logging in-->

 

<

 

location path="loginhelp.aspx">

 

<

 

system.web>

 

<

 

authorization>

 

<

 

allow users="?"/>

 

</

 

authorization>

 

<

 

compilation debug="true"/>

 

</

 

system.web>

 

</

 

location>

 

<

 

system.webServer>

 

<

 

validation validateIntegratedModeConfiguration="false"/>

 

<

 

defaultDocument>

 

<

 

files>

 

<

 

clear/>

 

<

 

add value="default_loc.aspx"/>

 

<

 

add value="default.aspx"/>

 

</

 

files>

 

</

 

defaultDocument>

 

<

 

handlers>

 

<

 

add name="Telerik.ReportViewer.axd_*" path="Telerik.ReportViewer.axd" verb="*" type="Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=3.0.9.430, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" preCondition="integratedMode,runtimeVersionv2.0"/>

 

</

 

handlers>

 

</

 

system.webServer>

 

</

 

configuration>
------------------------------------------------------------------------------------------------------------------------

 

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="chart.aspx.cs" Inherits="reporting_chart" %> 
<%@ Register Assembly="Telerik.ReportViewer.WebForms, Version=3.0.9.430, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" 
    Namespace="Telerik.ReportViewer.WebForms" TagPrefix="telerik" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml">  
<head runat="server">  
    <title></title>  
</head> 
<body> 
    <form id="form1" runat="server">  
    <div> 
        <h3>Header</h3> 
    <telerik:ReportViewer ID="ReportViewer1" runat="server" Height="482px"   
            Report="ReportingLib.Summary, ReportingLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"   
            Width="686px">  
        </telerik:ReportViewer> 
    </div> 
    </form> 
</body> 
</html> 
 --------------------------------------------------------------------------------------------------------------------

3 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 18 Jun 2009, 11:21 AM
Hello Jason,

The web.config file seems correct and it would seem that there is some problem with the report itself. In order to get a more meaningful error, please remove the report property from the .aspx markup and assign the viewer in code behind (Page_Load event handler):

ReportViewer1.Report = new ReportingLib.Summary();

Kind regards,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jason
Top achievements
Rank 1
answered on 18 Jun 2009, 06:44 PM
Dear Steve,
   Hi and thanks for your reply. I did what you suggested and now it seems the problem is data access for some strange reason. It seems the login credentials are getting lost. This is happening in the code behind for the report itself which exists in the class library. My connectionstring 'connSomsys' looks like what is below the dotted line .

   This sort of leads me to another issue which I had earlier which was  calling the ConfigurationManager class to retrieve this info but apparantly cannot be done at design time. See the post (http://www.telerik.com/community/forums/reporting/telerik-reporting/passing-connection-string-to-sub-report.aspx#849582)

   At anyrate, I need to know why suddenly my report cannot talk to sql now  because i put it on a .aspx page and if there is other connectionstring info I need to give it. Also why serving it with Visual Studio as opposed to iis would make a difference.

Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.   
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.Data.SqlClient.SqlException: Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.  
 
Source Error:   
 
 
Line 36:             selectInvoicetot = new SqlCommand("sprocgettotinvoicedorders", connSomsys);  
Line 37:             selectInvoicetot.CommandType = CommandType.StoredProcedure;  
Line 38:             selectInvoicetot.Parameters.AddWithValue("@year",2008);  
Line 39:             SqlDataAdapter adapter = new SqlDataAdapter(selectInvoicetot);  
Line 40:             DataSet dataSet = new DataSet();  
   
 
Source File: C:\inetpub\wwwroot\QuotedProj\ReportingLib\Summary.cs    Line: 38   
 
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------  
SqlConnection connSomsys = new SqlConnection(@"Server=cmdivst004\Jason08;Integrated Security=false;Database=QuoteDB; Persist Security Info=True;User ID=cmdiapp;Password=adiadmin"); 


 
0
Steve
Telerik team
answered on 22 Jun 2009, 02:45 PM
Hi Jason,

This is a generic .NET error that is usually caused by missing privileges. Usually adding NETWORK SERVICE as SQL user and set the same database access as the ASPNET user should help. Also you can review the following threads for more info on the matter:
  • http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataproviders/thread/a31656a9-5715-4910-ad96-fa590344a407
  • http://forums.asp.net/t/208909.aspx
  • http://forums.asp.net/p/258484/258484.aspx

All the best,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
Jason
Top achievements
Rank 1
Answers by
Steve
Telerik team
Jason
Top achievements
Rank 1
Share this question
or