My program calculates several static values such as TotalPounds. The values are calculated by the porgram before the Crystal report is called. I want to diplay these calculated values in the Page header of the Crystal report. I have created Parameters in Crystal. When I try to assign my calculated values to the Cystal report Parameter, I receive an invalid index message. I have checked my spelling and even used copy and paste to enure there are no mistakes. In the example below the datatype is set to number.
While I was trying to solve this problem, I discovered that my table.count = 0. (cryRpt.Database.Tables.co
unt = 0). Yet there are 4 tables in this report. See the code section.
When I preview the report in designer, it displays the correct data.
If I diplay the report programatically by skipping over the Paramater section, the report is blank. This is not suprising because the code skips over th LogonInfo section because its table count is zero.
Why isn't my code seeing the tables in the report?
Dim cryRpt As New ReportDocument
Dim crtableLogoninfos As New TableLogOnInfos
Dim crtableLogoninfo As New TableLogOnInfo
Dim crConnectionInfo As New ConnectionInfo
Dim CrTables As Tables
Dim CrTable As Table
.ServerName = Main.ServerNameStringPublic
.DatabaseName = "GMF"
.UserID = "Reports"
.Password = "reports"
CrTables = cryRpt.Database.Tables
For Each CrTable In CrTables
crtableLogoninfo = CrTable.LogOnInfo
crtableLogoninfo.ConnectionInfo = crConnectionInfo