I couldn't find an example that works. Here's what I have at the moment, though it changes as I try different things.
I dont attached recordsets to the reports as I want to use the DR designer independantly, and only have sufficient code in the app to show users a menu, then load the report.
What do you think?
Function LoadReport(ByVal strReportName As String)
Dim crxApp As New CRAXDDRT.Application
Dim crxRpt As CRAXDDRT.Report
Dim crxTables As CRAXDDRT.DatabaseTables
Dim crxTable As CRAXDDRT.DatabaseTable
Dim strreportpath As String
Dim strServerOrDSNName As String
Dim strDBNameOrPath As String
Dim strUserID As String
Dim strPassword As String
strServerOrDSNName = "servername"
strDBNameOrPath = "appname"
strreportpath = "" & Application.StartupPath & "\appname Reports\"
strUserID = ""
strPassword = ""
'// Open the report
crxRpt = crxApp.OpenReport("" & strreportpath & "" & strReportName & ".rpt")
'// Logon to the server
crxRpt.SetDatabaseLogon("", "", strServerOrDSNName, "appname")
For Each crxTable In crxRpt.Database.Tables
crxTable.SetLogOnInfo(strServerOrDSNName, "appname", "", "")
Next
'View the report
viewer.ReportSource = crxRpt
viewer.ViewReport()
End Function