Results 1 to 10 of 10

Thread: CRAXDRT.Dll (CR XI Viewer)

  1. #1

    Thread Starter
    Fanatic Member cid's Avatar
    Join Date
    Nov 2002
    Location
    Fort Worth, Texas
    Posts
    854

    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:
    1. Private Sub Form_Load()
    2.   Dim oApp As CRAXDRT.Application
    3.     Dim oReport As CRAXDRT.Report
    4.     Dim oRs As ADODB.Recordset
    5.     Dim sSQL As String
    6.  
    7.     sSQL = "SELECT * FROM Permits"
    8.     Set oRs = New ADODB.Recordset
    9.     Set oRs = oCnn.Execute(sSQL)
    10.     Set oApp = New CRAXDRT.Application
    11.     Set oReport = oApp.OpenReport(App.Path & "\Surface.", 1)
    12.     oReport.Database.SetDataSource oRs, 3, 1
    13.     crvMyCRViewer.ReportSource = oReport
    14.     crvMyCRViewer.ViewReport
    15. End Sub

    If anyone has any good refernces or ideas they would be greatly appreciated.

    www.google.com - Pay Tribute.

    Always Listening To: Thrice

  2. #2

    Thread Starter
    Fanatic Member cid's Avatar
    Join Date
    Nov 2002
    Location
    Fort Worth, Texas
    Posts
    854

    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:
    1. Set rs = cn.Execute(sSQL)

    www.google.com - Pay Tribute.

    Always Listening To: Thrice

  3. #3
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,930

    Re: CRAXDRT.Dll (CR XI Viewer)

    Have you set up oCnn/cn properly?

  4. #4

    Thread Starter
    Fanatic Member cid's Avatar
    Join Date
    Nov 2002
    Location
    Fort Worth, Texas
    Posts
    854

    Re: CRAXDRT.Dll (CR XI Viewer)

    I believe so....

    here is the code, for the form...

    VB Code:
    1. Option Explicit
    2. Dim rs As ADODB.Recordset
    3. Dim cn As ADODB.Connection
    4. Private Sub Form_Load()
    5.   Dim oApp As CRAXDRT.Application
    6.     Dim oReport As CRAXDRT.Report
    7.     Dim sSQL As String
    8.  
    9.     sSQL = "SELECT * FROM Permits Where " & frmSearch.Combo1.Text & " Is Like " & frmSearch.txtsearch.Text
    10.     Set rs = New ADODB.Recordset
    11.     Set rs = cn.Execute(sSQL)
    12.     Set App = New CRAXDRT.Application
    13.     Set oReport = oApp.OpenReport(App.Path & "\Surface.", 1)
    14.     oReport.Database.SetDataSource rs, 3, 1
    15.     crvMyCRViewer.ReportSource = oReport
    16.     crvMyCRViewer.ViewReport
    17. End Sub

    www.google.com - Pay Tribute.

    Always Listening To: Thrice

  5. #5
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,930

    Re: CRAXDRT.Dll (CR XI Viewer)

    You have a Dim, but no Set.

  6. #6
    PowerPoster
    Join Date
    Apr 2005
    Location
    Debug.Print
    Posts
    3,885

    Re: CRAXDRT.Dll (CR XI Viewer)

    Quote Originally Posted by cid
    I believe so....

    here is the code, for the form...

    VB Code:
    1. Option Explicit
    2. Dim rs As ADODB.Recordset
    3. Dim cn As ADODB.Connection
    4. Private Sub Form_Load()
    5.   Dim oApp As CRAXDRT.Application
    6.     Dim oReport As CRAXDRT.Report
    7.     Dim sSQL As String
    8.  
    9.     sSQL = "SELECT * FROM Permits Where " & frmSearch.Combo1.Text & " Is Like " & frmSearch.txtsearch.Text
    10.     Set rs = New ADODB.Recordset
    11.     Set rs = cn.Execute(sSQL)
    12.     Set App = New CRAXDRT.Application
    13.     Set oReport = oApp.OpenReport(App.Path & "\Surface.", 1)
    14.     oReport.Database.SetDataSource rs, 3, 1
    15.     crvMyCRViewer.ReportSource = oReport
    16.     crvMyCRViewer.ViewReport
    17. End Sub
    VB Code:
    1. Dim rs As ADODB.Recordset
    2. Dim cn As ADODB.Connection
    3. Set rs = New ADODB.Recordset
    4. Set cn = New ADODB.Connection

  7. #7

    Thread Starter
    Fanatic Member cid's Avatar
    Join Date
    Nov 2002
    Location
    Fort Worth, Texas
    Posts
    854

    Re: CRAXDRT.Dll (CR XI Viewer)

    Ok thanks for the help so far...

    Error:
    Invalid TLV Record:

    VB Code:
    1. Option Explicit
    2. Private Sub Form_Load()
    3. Dim rs As ADODB.Recordset
    4. Dim cn As ADODB.Connection
    5. Set rs = New ADODB.Recordset
    6. Set cn = New ADODB.Connection
    7. cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & App.Path & "\TractPro.mdb; Persist Security Info=False"
    8.   Dim oApp As CRAXDRT.Application
    9.     Dim oReport As CRAXDRT.Report
    10.     Dim sSQL As String
    11.     sSQL = "SELECT * FROM Permits"
    12.     cn.Open
    13.     Set rs = cn.Execute(sSQL)
    14.     Set oApp = New CRAXDRT.Application
    15.     Set oReport = oApp.OpenReport(App.Path & "\Surface.rpt", 1)
    16.     oReport.Database.SetDataSource rs, 3, 1
    17.     crvMyCRViewer.ReportSource = oReport
    18.     crvMyCRViewer.ViewReport
    19. 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

    www.google.com - Pay Tribute.

    Always Listening To: Thrice

  8. #8

    Thread Starter
    Fanatic Member cid's Avatar
    Join Date
    Nov 2002
    Location
    Fort Worth, Texas
    Posts
    854

    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.

    www.google.com - Pay Tribute.

    Always Listening To: Thrice

  9. #9

    Thread Starter
    Fanatic Member cid's Avatar
    Join Date
    Nov 2002
    Location
    Fort Worth, Texas
    Posts
    854

    Re: CRAXDRT.Dll (CR XI Viewer)

    bump

    www.google.com - Pay Tribute.

    Always Listening To: Thrice

  10. #10
    Addicted Member
    Join Date
    Jun 2006
    Posts
    219

    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
  •  



Click Here to Expand Forum to Full Width