Hi Phil,
If you are getting your data from a stored procedure, try to set the location property of every table in the report, as following: (this code is in Vb.net)
Dim ConInfo As New CrystalDecisions.Shared.TableLogOnInfo
ConInfo.ConnectionInfo.ServerName = "192.168.146.42"
ConInfo.ConnectionInfo.DatabaseName = "INFORISK"
ConInfo.ConnectionInfo.UserID = "sa"
ConInfo.ConnectionInfo.Password = "as"
For intCounter = 0 To objReport.Database.Tables.Count - 1
objReport.Database.Tables(intCounter).ApplyLogOnInfo(ConInfo)
' the following statement is necessary when using storedprocedures
>>>> objReport.Database.Tables(intCounter).Location = ";1"
Next
' Loop through each section on the report then look
' through each object in the section
' if the object is a subreport, then apply logon info
' on each table of that sub report
For index = 0 To objReport.ReportDefinition.Sections.Count - 1
For intCounter = 0 To objReport.ReportDefinition.Sections(index).ReportObjects.Count - 1
With objReport.ReportDefinition.Sections(index)
If .ReportObjects(intCounter).Kind = CrystalDecisions.Shared.ReportObjectKind.SubreportObject Then
mySubReportObject = CType(.ReportObjects(intCounter), CrystalDecisions.CrystalReports.Engine.SubreportObject)
mySubRepDoc = mySubReportObject.OpenSubreport(mySubReportObject.SubreportName)
For intCounter1 = 0 To mySubRepDoc.Database.Tables.Count - 1
>>>>>> mySubRepDoc.Database.Tables(intCounter1).Location = ";1"
Next
End If
End With
Next
Next
Hope to be helpful,
Regards,
Rodrigo.
Enter your message below
Sign in or Join us (it's free).