Hi,
I have made a report with a subreport when I want to display it I always get the message "Failed to load".
If I delete the subreport in my report it works fine.
I use Visual studio 2005 and crystal report 11 release 2.
This is a part of my code:
Dim mrptCrProc As New ReportDocument
mrptCrProc.Load(mstrReport)
For Each tbCurrent In mrptCrProc.Database.Tables
tliCurrent = tbCurrent.LogOnInfo
With tliCurrent.ConnectionInfo
.UserID = ""
.Password = ""
.ServerName = gstrServer
.DatabaseName = gstrDatabase
End With
tbCurrent.ApplyLogOnInfo(tliCurrent)
Next tbCurrent
'aply parameters
If gstrParameter(0).Value <> "" Then
For intCnt = 0 To UBound(gstrParameter)
crpdProc.Value = gstrParameter(intCnt).Value
crpColl.Add(crpdProc)
mrptCrProc.DataDefinition.ParameterFields(gstrParameter(intCnt).Name).ApplyCurrentValues(crpColl)
Next
End If
crViewer.ReportSource = mrptCrProc
Thanks in advance
Elsje
I have made a report with a subreport when I want to display it I always get the message "Failed to load".
If I delete the subreport in my report it works fine.
I use Visual studio 2005 and crystal report 11 release 2.
This is a part of my code:
Dim mrptCrProc As New ReportDocument
mrptCrProc.Load(mstrReport)
For Each tbCurrent In mrptCrProc.Database.Tables
tliCurrent = tbCurrent.LogOnInfo
With tliCurrent.ConnectionInfo
.UserID = ""
.Password = ""
.ServerName = gstrServer
.DatabaseName = gstrDatabase
End With
tbCurrent.ApplyLogOnInfo(tliCurrent)
Next tbCurrent
'aply parameters
If gstrParameter(0).Value <> "" Then
For intCnt = 0 To UBound(gstrParameter)
crpdProc.Value = gstrParameter(intCnt).Value
crpColl.Add(crpdProc)
mrptCrProc.DataDefinition.ParameterFields(gstrParameter(intCnt).Name).ApplyCurrentValues(crpColl)
Next
End If
crViewer.ReportSource = mrptCrProc
Thanks in advance
Elsje