Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Using Crystal Reports Viewer in Microsoft Access 2002

Posted on 2004-11-11
8
Medium Priority
?
2,226 Views
Last Modified: 2012-05-05
We are trying to use the Crystal ActiveX Report Viewer Control 10.0 on an Access Form to display a Crystal Report (*.rpt), that has no parameters, or even data links (the report is just an empty form).  I've searched for quite awhile on the net trying to find out how to display the report.  I've tried the following sites:

http://www.crystalkeen.com/articles/crystalreports/rdcinvba.htm (results in Type mismatch in createobject line)
http://www.necrug.com/Crystal-Training/crystal-forum-message.asp?site=&topicid=4213 (Failed on app.CreateReport)

I have added the Crystal ActiveX Report Viewer Control 10.0 to the form, and am referencing Crystal ActiveX Designer RunTime Library 10.0 and Crystal ActiveX Report Viewer Library 10.0.

Can someone please suggest some code for Form1 that would make the ActiveX report viewer (CRViewer) display the report ("C:\report.rpt")?

Any assistance would be appreciated...this is the final stroke in the application.

Kevin
0
Comment
Question by:kmoloney
  • 4
  • 3
8 Comments
 
LVL 14

Accepted Solution

by:
RDWaibel earned 2000 total points
ID: 12557266
ok...
Step one)  in the references be sure to have then Crystal Report View Control and the 10.0 ActiveX Runtime Library checked

 Step 2)  Add the Crystal Report Viiewer to your Form (I make a form for Report Review only, then just change the report name each time I need a preview.  The code here is a one shot deal, only the report.rpt)
 
 Step 3) Add the following to the General Declarations:

Dim crApp As CRAXDRT.Application
Dim REPORT As CRAXDRT.REPORT

 Step 4)  Here is the Form Open event:

Private Sub Form_Open(Cancel As Integer)
    Set crApp = CreateObject("CrystalRunTime.application")
    Set REPORT = crApp.OpenReport("Report1.rpt")
   
    With crViewer
        .ReportSource = REPORT
        .ViewReport
        .EnablePrintButton = True
    End With
End Sub

Rob
0
 
LVL 2

Author Comment

by:kmoloney
ID: 12559337
Rob -

I get a Runtime Error 13 - Type Mismatch, when the following line attempts to run:

Set crApp = CreateObject("CrystalRunTime.Application")

Same problem I had with the solution at http://www.crystalkeen.com/articles/crystalreports/rdcinvba.htm.

What is this line attempting to do?


0
 
LVL 14

Expert Comment

by:RDWaibel
ID: 12559511
it is creating the Crystal Reports Application object based on the Crystal Report Runtime.  (Just  note, I use Crystal 8.5 BUT it is suppose to work on all version After V7)

Look for a CRAXDRT.dll in your System32 Directory
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Author Comment

by:kmoloney
ID: 12560167
Okay, here's probably what the problem was:

In my Toolbox, I have:

Crystal Report Viewer Control (crviewer.dll in Windows\System32\)
Crystal Report Viewer Control 9 (crviewer9.dll in Windows\Downloaded Program Files\)
Crystal ActiveX Report Viewer Control 10.0 (crviewer.dll in C:\Program Files\Common Files\Crystal Decisions\2.5\crystalreportviewers10\ActiveXControls\)

I think I straightened out part of this because I did have the craxdrt.dll available and checked.  But now it gives me the following error:

Run-time error '-2147206429 (80043ae3)':
Invalid TLV record

Also, another thing I noticed is that if I double click on a *.rpt file, it asks me to log on to Crystal Enterprise.  We don't have crystal enterprise, but there are a lot of available references to Crystal Enterprise.  Anyway, I have to click "Cancel" and then I can see the report.
0
 
LVL 2

Author Comment

by:kmoloney
ID: 12560240
PLEASE POST ANY RESPONSES IN THE FOLLOWING URL: http://www.experts-exchange.com/Databases/Crystal_Reports/Q_21203530.html.  I will still award all 500 points.
0
 
LVL 14

Expert Comment

by:RDWaibel
ID: 12560241
ok....

loose this {Crystal Report Viewer Control 9 (crviewer9.dll in Windows\Downloaded Program Files\)}
and {Crystal ActiveX Report Viewer Control 10.0 (crviewer.dll in C:\Program Files\Common Files\Crystal Decisions\2.5\crystalreportviewers10\ActiveXControls\)}

then try it
0
 
LVL 2

Author Comment

by:kmoloney
ID: 12574760
RD -

Your answer was fine.  However, I'm still having a problem with an "Invalid TLV Record" error message.  This appears to be outside the scope of Microsoft Access and VBA, but is a Crystal Reports problem.  This question is posted again in the Crystal Reports section.

Thanks!

Kevin
0
 

Expert Comment

by:aurionpro
ID: 14935386
Crystal Reports ActiveX Designer error '80043ae3'

Invalid TLV record.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
A Case Study of using the Windows API to provide RS232 communications capability in Access without the use of Active-X controls.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question