I have a CR 8.5 Developer using the RDC and have this code. I just upgraded to 10.0 Developer and need to modify the code for upgrade. It gives me errors when I try to use this code after the upgrade. Not sure what I need to change to make it work.
Code:
Dim Report As New rptinvsum
Dim Subreport As CRAXDRT.Report
Dim SubObject As CRAXDRT.SubreportObject
Private Sub Connect()
' Pass the connection for the main report.
Report.Database.Tables(1).SetLogOnInfo "dsnduty", "", "", ""
' Pass the connection for the subreport. Locate subreports in the report.
For X = 1 To Report.Sections.count
For Y = 1 To Report.Sections(X).ReportObjects.count
If Report.Sections(X).ReportObjects(Y).Kind = crSubreportObject Then
Set SubObject = Report.Sections(X).ReportObjects(Y)
Set Subreport = Report.OpenSubreport(SubObject.SubreportName)
Subreport.Database.Tables(1).SetLogOnInfo "dsnduty", "", "", ""
End If
Next Y
Next X
End Sub
Private Sub Form_Load()
Set Report = Nothing
Connect
'invoice number
Report.ParameterFields(1).ClearCurrentValueAndRange
Report.ParameterFields(1).AddCurrentValue Pinv
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
End Sub
Private Sub Form_Resize()
CRViewer1.Top = 0
CRViewer1.Left = 0
CRViewer1.Height = ScaleHeight
CRViewer1.Width = ScaleWidth
End Sub