"Invalid Field name " error.

I am using CR 2008, VB .NET 2005 and SQL Server 2008.

I have built a report in CR 2008 that has a simple graph in a subreport. I can run this in desing mode from my computer without any problems. I then save the report to my Enterprise and try to schedule it with VB code and it won’t schedule. It is having a problem with the subreport. Here is the part of my code where I get the error:

Dim subreportTable As CrystalDecisions.ReportAppServer.DataDefModel.ISCRTable = sourceDatabaseForSubreport.Tables(0)
Dim subreportTableClone As CrystalDecisions.ReportAppServer.DataDefModel.ISCRTable
subreportTableClone = subreportTable.Clone(True)
subreportTableClone.ConnectionInfo.Attributes = subreportTable.ConnectionInfo.Attributes.Clone(True)
subreportTableClone.ConnectionInfo.Attributes("Data Source") = "xxxx"
subreportTableClone.ConnectionInfo.Attributes("Initial Catalog") = "xxxx"
subreportTableClone.ConnectionInfo.UserName = mySubreportUsername
subreportTableClone.ConnectionInfo.Password = mySubreportPassword
Try
       mySubreportController.SetTableLocation(srName, subreportTable, subreportTableClone)
Catch ex As Exception
       MessageBox.Show("There is a problem with the " & srName & " subreport!!", "Report(s) Scheduled", MessageBoxButtons.OK)
       myEnterpriseSession.Logoff()
       myEnterpriseSession.Dispose()
       Exit Sub
End Try

Here is the error that I get:
COMException was caught
Invalid field name.
{14327D21-8815-4847-88E0-494E272E9C8C}.rpt

The line that creates the error is right after the Try statement.

The subreport is based on a stored procedure in SQL server and I have checked to make sure that the parameters that I am passing in code have the same data type as the parameters in the stored procedure.

Any help would be greatly appreciated!!


conwa02976 (BOB member since 2009-04-20)