Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB .Net using Crystal ActiveX Report object

Status
Not open for further replies.

adale

Programmer
Apr 18, 2001
48
0
0
GB
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(n).SetLogOnInfo(strServerOrDSNName, strDBNameOrPath)
Next n

'View the report
AxCrystalActiveXReportViewer1.ReportSource = crxRpt
AxCrystalActiveXReportViewer1.ViewReport()
 
I'm sure it would work if I had VS.Net, but I only have VB.Net.
The best I can get is for the report to be pointed at the server before being referred to in the app.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top