Hi There,
I have two possibly related problems.
Firstly all my crystal XI reports work fine in visual studio 2005 using ASP.Net. I can even create an installation msi install it locally and run the web page from IIS from mine and any other computer and the reports run fine. When I run it on the server I get a two distinct error types.
1. The server doesn't have business objects just the CRRedist2005_x86.msi - I obviously have visual studio 2005 with all the latest service packs for both crystal and vs. This is the only real differerence I can detect.
Are there libraries/updates or something that I am missing on the server that could correct these errors?
Anyway...
Error 1.
I have a report which is a holder for 11 subreports.
The error I get is as follows.
n.b. I have created numerous Report Custom Functions and I'm thinking it has something to do with these.
This field name is not known. Error in File C:\WINDOWS\TEMP\CRManagementReports {70D793DA-CFE8-421F-BF0B-C2ADF4C26408}.rpt: Error in formula . '( ' This field name is not known.
Error 2. Anyway if I remove the RCF's, which again work perfectly on my machine, the report gets it's next error which is it basically loses all connection information that I set in .net Code that works perfectly on my machine.
It loses all information even the database name which is a readonly field so you can't even type it in with the username and password to get the report. Obviously this screen should be skipped as I have set this information already but crystal loses it.
IEBTSAP1 Server name:
Database name:
User name:
Password:
Use Integrated Security
I have tried multiple methods of setting the connection but it still loses the settings.
Like...
Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo()
With myConnectionInfo
.ServerName = _SQLServerName
.DatabaseName = _ReportingDatabaseName
.UserID = _DBUserName
.Password = _DBPassword
.IntegratedSecurity = False
'.IntegratedSecurity = True
End With
Private Sub SetDBLogonForReport(ByVal myConnectionInfo As ConnectionInfo, ByVal myReportDocument As ReportDocument)
Dim myTables As Tables = myReportDocument.Database.Tables
Dim myTable As CrystalDecisions.CrystalReports.Engine.Table
For Each myTable In myTables
Dim myTableLogonInfo As TableLogOnInfo = myTable.LogOnInfo
myTableLogonInfo.ConnectionInfo = myConnectionInfo
myTable.ApplyLogOnInfo(myTableLogonInfo)
Next
End Sub
Private Sub SetDBLogonForSubreports(ByVal myConnectionInfo As ConnectionInfo, ByVal myReportDocument As ReportDocument)
Dim mySections As Sections = myReportDocument.ReportDefinition.Sections
Dim mySection As Section
For Each mySection In mySections
Dim myReportObjects As ReportObjects = mySection.ReportObjects
Dim myReportObject As ReportObject
For Each myReportObject In myReportObjects
If myReportObject.Kind = ReportObjectKind.SubreportObject Then
Dim mySubreportObject As SubreportObject = CType(myReportObject, SubreportObject)
Dim subReportDocument As ReportDocument = mySubreportObject.OpenSubreport(mySubreportObject.SubreportName)
SetDBLogonForReport(myConnectionInfo, subReportDocument)
End If
Next
Next
End Sub
OR
_CRReport.SetDatabaseLogon(_DBUserName, _DBPassword, _SQLServerName, _ReportingDatabaseName)
and the other subreport one but none work.
Is there a service pack for the CRRedist2005_x86.msi or something?
Again all works on my machine with same .net version IIS etc. Server is Windows 2003.
Cheers.
Luke
I have two possibly related problems.
Firstly all my crystal XI reports work fine in visual studio 2005 using ASP.Net. I can even create an installation msi install it locally and run the web page from IIS from mine and any other computer and the reports run fine. When I run it on the server I get a two distinct error types.
1. The server doesn't have business objects just the CRRedist2005_x86.msi - I obviously have visual studio 2005 with all the latest service packs for both crystal and vs. This is the only real differerence I can detect.
Are there libraries/updates or something that I am missing on the server that could correct these errors?
Anyway...
Error 1.
I have a report which is a holder for 11 subreports.
The error I get is as follows.
n.b. I have created numerous Report Custom Functions and I'm thinking it has something to do with these.
This field name is not known. Error in File C:\WINDOWS\TEMP\CRManagementReports {70D793DA-CFE8-421F-BF0B-C2ADF4C26408}.rpt: Error in formula . '( ' This field name is not known.
Error 2. Anyway if I remove the RCF's, which again work perfectly on my machine, the report gets it's next error which is it basically loses all connection information that I set in .net Code that works perfectly on my machine.
It loses all information even the database name which is a readonly field so you can't even type it in with the username and password to get the report. Obviously this screen should be skipped as I have set this information already but crystal loses it.
IEBTSAP1 Server name:
Database name:
User name:
Password:
Use Integrated Security
I have tried multiple methods of setting the connection but it still loses the settings.
Like...
Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo()
With myConnectionInfo
.ServerName = _SQLServerName
.DatabaseName = _ReportingDatabaseName
.UserID = _DBUserName
.Password = _DBPassword
.IntegratedSecurity = False
'.IntegratedSecurity = True
End With
Private Sub SetDBLogonForReport(ByVal myConnectionInfo As ConnectionInfo, ByVal myReportDocument As ReportDocument)
Dim myTables As Tables = myReportDocument.Database.Tables
Dim myTable As CrystalDecisions.CrystalReports.Engine.Table
For Each myTable In myTables
Dim myTableLogonInfo As TableLogOnInfo = myTable.LogOnInfo
myTableLogonInfo.ConnectionInfo = myConnectionInfo
myTable.ApplyLogOnInfo(myTableLogonInfo)
Next
End Sub
Private Sub SetDBLogonForSubreports(ByVal myConnectionInfo As ConnectionInfo, ByVal myReportDocument As ReportDocument)
Dim mySections As Sections = myReportDocument.ReportDefinition.Sections
Dim mySection As Section
For Each mySection In mySections
Dim myReportObjects As ReportObjects = mySection.ReportObjects
Dim myReportObject As ReportObject
For Each myReportObject In myReportObjects
If myReportObject.Kind = ReportObjectKind.SubreportObject Then
Dim mySubreportObject As SubreportObject = CType(myReportObject, SubreportObject)
Dim subReportDocument As ReportDocument = mySubreportObject.OpenSubreport(mySubreportObject.SubreportName)
SetDBLogonForReport(myConnectionInfo, subReportDocument)
End If
Next
Next
End Sub
OR
_CRReport.SetDatabaseLogon(_DBUserName, _DBPassword, _SQLServerName, _ReportingDatabaseName)
and the other subreport one but none work.
Is there a service pack for the CRRedist2005_x86.msi or something?
Again all works on my machine with same .net version IIS etc. Server is Windows 2003.
Cheers.
Luke