Has anybody managed to get the ActiveX reporting object to work. We have the regular CrystalReporting object working, but it lacks the cool search/filter function.
We're using CR10 with VB.Net to a SQL server.
Here's the code we used in VB6 that worked.
Dim secSecurity As Security.SecurityZone
Dim crxApp As New CRAXDRT.Application
Dim crxRpt As CRAXDRT.Report
Dim crxTables As CRAXDRT.DatabaseTables
Dim crxTable As CRAXDRT.DatabaseTable
Dim strreportpath As String
Dim strServerOrDSNName As String
Dim strDBNameOrPath As String
Dim strUserID As String
Dim strPassword As String
Dim n As Integer
'strServerOrDSNName = "whexddb00003\uat"
strServerOrDSNName = "whexdapdsb01\inst"
strDBNameOrPath = "River"
strreportpath = "" & Application.StartupPath & "\River Reports\"
'strUserID = ""
'strPassword = ""
'Open the report
crxRpt = crxApp.OpenReport("" & strreportpath & "" & strReportName & ".rpt")
crxTables = crxRpt.Database.Tables
For Each crxTable In crxTables
With crxTable
.Location = .Location
End With
Next
'Set the connection for the report.
For n = 1 To crxRpt.Database.Tables.Count
crxRpt.Database.Tables
.SetLogOnInfo(strServerOrDSNName, strDBNameOrPath)
Next n
'View the report
AxCrystalActiveXReportViewer1.ReportSource = crxRpt
AxCrystalActiveXReportViewer1.ViewReport()
We're using CR10 with VB.Net to a SQL server.
Here's the code we used in VB6 that worked.
Dim secSecurity As Security.SecurityZone
Dim crxApp As New CRAXDRT.Application
Dim crxRpt As CRAXDRT.Report
Dim crxTables As CRAXDRT.DatabaseTables
Dim crxTable As CRAXDRT.DatabaseTable
Dim strreportpath As String
Dim strServerOrDSNName As String
Dim strDBNameOrPath As String
Dim strUserID As String
Dim strPassword As String
Dim n As Integer
'strServerOrDSNName = "whexddb00003\uat"
strServerOrDSNName = "whexdapdsb01\inst"
strDBNameOrPath = "River"
strreportpath = "" & Application.StartupPath & "\River Reports\"
'strUserID = ""
'strPassword = ""
'Open the report
crxRpt = crxApp.OpenReport("" & strreportpath & "" & strReportName & ".rpt")
crxTables = crxRpt.Database.Tables
For Each crxTable In crxTables
With crxTable
.Location = .Location
End With
Next
'Set the connection for the report.
For n = 1 To crxRpt.Database.Tables.Count
crxRpt.Database.Tables
Next n
'View the report
AxCrystalActiveXReportViewer1.ReportSource = crxRpt
AxCrystalActiveXReportViewer1.ViewReport()