|
-
Dec 18th, 2005, 04:47 PM
#1
Thread Starter
Fanatic Member
CRAXDRT.Dll (CR XI Viewer)
For some reason there arent many CR XI resources available. As a matter of fact, Robdogg's code on the forums is about all I could find when it came to attaching data to the CRViwer. The only problem is it says my object is not defined, and it is talking about CRAXDRT being not referenced(I assume that is the crystal reports viewer control).
Main problem.
I have CR XI and I am using Crystal Reports Active X Viewing Control and i cant find any help on getting it to view a report through visual basic. The only code i could find came from robdogg and i got a referencing error. Maybe it is because I am missing a .dll *exp craxdrt.dll
I honestly dont know.
Here is the code i attempted to use:
VB Code:
Private Sub Form_Load()
Dim oApp As CRAXDRT.Application
Dim oReport As CRAXDRT.Report
Dim oRs As ADODB.Recordset
Dim sSQL As String
sSQL = "SELECT * FROM Permits"
Set oRs = New ADODB.Recordset
Set oRs = oCnn.Execute(sSQL)
Set oApp = New CRAXDRT.Application
Set oReport = oApp.OpenReport(App.Path & "\Surface.", 1)
oReport.Database.SetDataSource oRs, 3, 1
crvMyCRViewer.ReportSource = oReport
crvMyCRViewer.ViewReport
End Sub
If anyone has any good refernces or ideas they would be greatly appreciated.
-
Dec 18th, 2005, 05:10 PM
#2
Thread Starter
Fanatic Member
Re: CRAXDRT.Dll (CR XI Viewer)
I downloaded older versions of the craxdrt.dll and crviewer.dll and it seems to be working now...
I get the error
"Object or with block variable not set"
on line:
VB Code:
Set rs = cn.Execute(sSQL)
-
Dec 18th, 2005, 06:23 PM
#3
Re: CRAXDRT.Dll (CR XI Viewer)
Have you set up oCnn/cn properly?
-
Dec 18th, 2005, 06:25 PM
#4
Thread Starter
Fanatic Member
Re: CRAXDRT.Dll (CR XI Viewer)
I believe so....
here is the code, for the form...
VB Code:
Option Explicit
Dim rs As ADODB.Recordset
Dim cn As ADODB.Connection
Private Sub Form_Load()
Dim oApp As CRAXDRT.Application
Dim oReport As CRAXDRT.Report
Dim sSQL As String
sSQL = "SELECT * FROM Permits Where " & frmSearch.Combo1.Text & " Is Like " & frmSearch.txtsearch.Text
Set rs = New ADODB.Recordset
Set rs = cn.Execute(sSQL)
Set App = New CRAXDRT.Application
Set oReport = oApp.OpenReport(App.Path & "\Surface.", 1)
oReport.Database.SetDataSource rs, 3, 1
crvMyCRViewer.ReportSource = oReport
crvMyCRViewer.ViewReport
End Sub
-
Dec 18th, 2005, 06:28 PM
#5
Re: CRAXDRT.Dll (CR XI Viewer)
You have a Dim, but no Set.
-
Dec 18th, 2005, 06:35 PM
#6
PowerPoster
Re: CRAXDRT.Dll (CR XI Viewer)
 Originally Posted by cid
I believe so....
here is the code, for the form...
VB Code:
Option Explicit
Dim rs As ADODB.Recordset
Dim cn As ADODB.Connection
Private Sub Form_Load()
Dim oApp As CRAXDRT.Application
Dim oReport As CRAXDRT.Report
Dim sSQL As String
sSQL = "SELECT * FROM Permits Where " & frmSearch.Combo1.Text & " Is Like " & frmSearch.txtsearch.Text
Set rs = New ADODB.Recordset
Set rs = cn.Execute(sSQL)
Set App = New CRAXDRT.Application
Set oReport = oApp.OpenReport(App.Path & "\Surface.", 1)
oReport.Database.SetDataSource rs, 3, 1
crvMyCRViewer.ReportSource = oReport
crvMyCRViewer.ViewReport
End Sub
VB Code:
Dim rs As ADODB.Recordset
Dim cn As ADODB.Connection
Set rs = New ADODB.Recordset
Set cn = New ADODB.Connection
-
Dec 18th, 2005, 08:16 PM
#7
Thread Starter
Fanatic Member
Re: CRAXDRT.Dll (CR XI Viewer)
Ok thanks for the help so far...
Error:
Invalid TLV Record:
VB Code:
Option Explicit
Private Sub Form_Load()
Dim rs As ADODB.Recordset
Dim cn As ADODB.Connection
Set rs = New ADODB.Recordset
Set cn = New ADODB.Connection
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & App.Path & "\TractPro.mdb; Persist Security Info=False"
Dim oApp As CRAXDRT.Application
Dim oReport As CRAXDRT.Report
Dim sSQL As String
sSQL = "SELECT * FROM Permits"
cn.Open
Set rs = cn.Execute(sSQL)
Set oApp = New CRAXDRT.Application
Set oReport = oApp.OpenReport(App.Path & "\Surface.rpt", 1)
oReport.Database.SetDataSource rs, 3, 1
crvMyCRViewer.ReportSource = oReport
crvMyCRViewer.ViewReport
End Sub
Anyone have any ideas... while you guys try and work this out with me, im going to google and find out what a TLV record is
-
Dec 18th, 2005, 08:20 PM
#8
Thread Starter
Fanatic Member
Re: CRAXDRT.Dll (CR XI Viewer)
Alright, I figured out what the problem is... Since i dont have CR 9/10.0 installed I cant use the 10.0 CRViewer...
I have CR XI on this computer...
Does anyone have any ideas for transfering the code above for CR 10 to CR11..?
I would be using the Crystal Reports Active X Control packaged with CR11... I would have been using it this entire time but there is very little documentation on it.
-
Dec 20th, 2005, 08:49 AM
#9
Thread Starter
Fanatic Member
Re: CRAXDRT.Dll (CR XI Viewer)
-
Aug 22nd, 2006, 11:46 PM
#10
Addicted Member
Re: CRAXDRT.Dll (CR XI Viewer)
Dear CID,
Have you got the solution?
if so, please guide me - i am aslo facing same problem with CR - XI.
Please Please Please
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|