How to configure crystal reports viewer activex so that I can open a crystal report from within access.

Hi,

I see where I can insert the ActiveX control called Crystal ActiveX Report Viewer Control 10.0, but then I don't know what to do with it. Where do I enter information about the report I want to show?

Thanks
Bonnie
LVL 1
Bonnie_KAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mlmccCommented:
Are you doing tis in Access or are you building an application in VB?

The viewer is just a viewer.  You need to set properties for it and attach the report to it.  You also need other Crystal references.

mlmcc
0
Bonnie_KAuthor Commented:
in access itself.  
0
mlmccCommented:
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Bonnie_KAuthor Commented:
Well, I looked at those files, but I am working with Access 97 and Crystal 10, so I couldn't even open the db on the machine with crystal 10 installed.

I found this code on another post and added the ActiveX control to a form and put this code "on load" but I get an error:

Private Sub Form_Load()

Dim crxApp As CRAXDDRT.Application
Dim crxRpt As CRAXDDRT.Report


Set crxApp = New CRAXDDRT.Application
Set crxRpt = crxApp.OpenReport("H:\Dataware\mdbs\PriceList.rpt", 1)

With crxRpt
  .DiscardSavedData
End With

With Me.acxCrystalViewer
    .ReportSource = crxRpt
    .ViewReport
    .DisplayGroupTree = False
     .Zoom 2
End With

End Sub

I get the following error on the line With Me.acxCrystalViewer:

Compile Error: Method or Data member not found.

Any ideas?  Am I maybe missing a reference?

Thanks,
Bonnie
0
Bonnie_KAuthor Commented:
I found some of your code on another post (see below) and am using that.  I saw that I need to name the activex control rptCRViewer but now I am getting method or data member not found on Me.Show.

Thanks,
Bonnie
Private Sub Form_Load()
 
 
    Dim crApp As CRAXDRT.Application
    Dim crRpt As CRAXDRT.Report
 
On Error GoTo ErrHandler
 
 
'
'   Open report
'
    Set crApp = New CRAXDRT.Application
 
    Set crRpt = crApp.OpenReport("H:\Dataware\mdbs\pricelist.rpt", 1)
 '   crRpt.RecordSelectionFormula = txtSelectClause
 
'
'   Set flags for CRViewer
'
    crRpt.MorePrintEngineErrorMessages = False
    crRpt.EnableParameterPrompting = False
    crRpt.DiscardSavedData
 
 
'
' Set the viewer's report source to the Report object
'
    Me.rptCRViewer.ReportSource = crRpt
    Me.rptCRViewer.ViewReport
    Me.Show
 
    Exit Sub
 
End Sub

Open in new window

0
mlmccCommented:
Both sets of code are VB6 not VBA thus the problems.

I opened it.  Not sure what version of Access it uses but it is for CR9.

Code behind the form is attached

mlmcc
RDC-VBA.txt
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bonnie_KAuthor Commented:
I see, I will try to work with the VBA code.  Thanks again.
0
Bonnie_KAuthor Commented:
So far, so good, it tries to load the report into the control.

The database where the data for the report comes from is password protected.  Do you know how I can pass the password in when opening the file?

Thanks so much for your help,
Bonnie
0
Bonnie_KAuthor Commented:
Never mind mlmcc, I switched the datasource to ODBC and am not getting prompted and can view the report.

I wish I could give you more that 500 points for this.  I banged my head against the wall for many hours about this before submitting the question.

Thanks so much,
Bonnie
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.