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

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2692
  • Last Modified:

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
0
Bonnie_K
Asked:
Bonnie_K
  • 6
  • 3
1 Solution
 
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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
 
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

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 6
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now