Crystal Reports XI Release 2. Deployed on Windows Server. Built with VS 2005.
I'm trying to get my first web deployment of CR going. I'm getting the following error:
Failed to open the connection. Failed to open the connection. C:\WINDOWS\TEMP\ReedCorpReport {046213D8-2B13-4959-9F93-525104CB2FB3}.rpt
CrystalReportViewer - myCrystalReportViewer
Error: Object reference not set to an instance of an object.
I built the Crystal Report web app using the tutorial and it works fine on my development PC. (like everyone else!)
Here is my code, Default.aspx, Default.aspx.vb, and web.config.
I apologize ahead of time for the amount of code I pasted into thread but I am very frustrated and hope someone can lend a hand.
Thanks for any insight on this:
Kevin
=======================
Option
Strict OnImports
CrystalDecisions.CrystalReports.EngineImports
CrystalDecisions.SharedImports
System.Collections
Partial
Class _Default Inherits System.Web.UI.Page Private Const PARAMETER_FIELD_NAME As String = "Enterprise" Private Sub ConfigureCrystalReports() Dim reportPath As StringreportPath = Server.MapPath(
"reports\ReedCorpReport.rpt") Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo()myConnectionInfo.ServerName =
"My Server Name"myConnectionInfo.DatabaseName =
"My Database Name"myConnectionInfo.UserID =
"My User ID"myConnectionInfo.Password =
"My User ID Password" Dim myArrayList As ArrayList = New ArrayList()myArrayList.Add(
"29")myArrayList.Add(
"36")myCrystalReportViewer.ReportSource = reportPath
Dim myParameterFields As ParameterFields = myCrystalReportViewer.ParameterFieldInfoSetCurrentValuesForParameterField(myParameterFields, myArrayList)
SetDBLogonForReport(myConnectionInfo)
End Sub Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
ConfigureCrystalReports()
End Sub Private Sub SetDBLogonForReport(ByVal myConnectionInfo As ConnectionInfo) Dim myTableLogOnInfos As TableLogOnInfos = myCrystalReportViewer.LogOnInfo For Each myTableLogOnInfo As TableLogOnInfo In myTableLogOnInfosmyTableLogOnInfo.ConnectionInfo = myConnectionInfo
Next End Sub Private Sub SetCurrentValuesForParameterField(ByVal myParameterFields As ParameterFields, ByVal myArrayList As ArrayList) Dim currentParameterValues As ParameterValues = New ParameterValues() For Each submittedValue As Object In myArrayList Dim myParameterDiscreteValue As ParameterDiscreteValue = New ParameterDiscreteValue()myParameterDiscreteValue.Value = submittedValue.ToString()
currentParameterValues.Add(myParameterDiscreteValue)
Next Dim myParameterField As ParameterField = myParameterFields(PARAMETER_FIELD_NAME)myParameterField.CurrentValues = currentParameterValues
End SubEnd
Class=================================================
My Default.aspx page with the Crystal Viewer looks like this:
<%
@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %><%
@ Register Assembly="CrystalDecisions.Web, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" Namespace="CrystalDecisions.Web" TagPrefix="CR" %><!
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>Untitled Page</title></
head><
body> <form id="form1" runat="server"> <div> <CR:CrystalReportViewer ID="myCrystalReportViewer" runat="server" AutoDataBind="true" /> </div> </form></
body></
html>=================================================
My web.config
<
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><
appSettings><
add key="CrystalImageCleaner-AutoStart" value="true" /><
add key="CrystalImageCleaner-Sleep" value="60000" /><
add key="CrystalImageCleaner-Age" value="120000" /></
appSettings><
connectionStrings/><
system.web><!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
Visual Basic options:
Set strict="true" to disallow all data type conversions
where data loss can occur.
Set explicit="true" to force declaration of all variables.
--><
compilation debug="true" strict="false" explicit="true"><
assemblies><
add assembly="CrystalDecisions.Web, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/><
add assembly="CrystalDecisions.Shared, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/><
add assembly="CrystalDecisions.ReportSource, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/><
add assembly="CrystalDecisions.Enterprise.Framework, Version=11.5.3300.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/><
add assembly="CrystalDecisions.Enterprise.Desktop.Report, Version=11.5.3300.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/><
add assembly="CrystalDecisions.ReportAppServer.Controllers, Version=11.5.3300.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/><
add assembly="CrystalDecisions.CrystalReports.Engine, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/><
add assembly="CrystalDecisions.Enterprise.InfoStore, Version=11.5.3300.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/><
add assembly="CrystalDecisions.Enterprise.Viewing.ReportSource, Version=11.5.3300.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/><add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=11.5.3300.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/></assemblies></compilation><
pages><
namespaces><
clear/><
add namespace="System"/><
add namespace="System.Collections"/><
add namespace="System.Collections.Specialized"/><
add namespace="System.Configuration"/><
add namespace="System.Text"/><
add namespace="System.Text.RegularExpressions"/><
add namespace="System.Web"/><
add namespace="System.Web.Caching"/><
add namespace="System.Web.SessionState"/><
add namespace="System.Web.Security"/><
add namespace="System.Web.Profile"/><
add namespace="System.Web.UI"/><
add namespace="System.Web.UI.WebControls"/><
add namespace="System.Web.UI.WebControls.WebParts"/><
add namespace="System.Web.UI.HtmlControls"/></
namespaces></
pages><!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
--><
authentication mode="Windows"/><!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
--><
httpHandlers><add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=11.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/></httpHandlers></system.web></
configuration>
Deployment error with CR XI R2 on Windows Server
C&#35;TURK
sjm8
Did you ever resolve this problem I am having similar issue and would like to know how you resolved this issue.
Thanks,
SMA
austism@dshs.wa.gov
andykennaugh1062
As a followup to my question, since I can't get any of the documented samples to deploy on our windows server, could it be possible that it is a matter of application permissions on the web server Is there a guide/checklist I could use to check the IIS configuratioin side of things.
Thanks.
Kevin