Discussion Locked

How to call Crystal Reports from Access

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Pl. can anyone tell me how to call Crystal Reports (8.5) from ACCESS 2000?.

Thanks a lot in advance

6 replies

by miss kitty

First you must add a Crystal Report Control and a CRViewer Control to your project (you do this under projects and then references. Then you can add the code below.
Dim crxApplication As New CRAXDRT.Application
Public Report As CRAXDRT.Report
Dim crxDatabaseTable As CRAXDRT.DatabaseTable
Dim crxParameterField As CRAXDRT.ParameterFieldDefinition
Dim crxFormulaField As CRAXDRT.FormulaFieldDefinition

strReport = ("G:\ACCESS\SIS\RPTRSG02\" & frmMain.GetFileName & " CUST ALL DATES.rpt")
Set Report = crxApplication.OpenReport(strReport, 1)
frmViewer.Show vbModal

Add a new form and put a CRViewer control on it then code it as follows:

Option Explicit

Private Sub Form_Load()
'Screen.MousePointer = vbHourglass
CRViewer.ReportSource = frmCustReports.Report
CRViewer.ViewReport
End Sub

Private Sub Form_Resize()
CRViewer.Top = 0
CRViewer.Left = 0
CRViewer.Height = ScaleHeight
CRViewer.Width = ScaleWidth
End Sub
Private Sub Form_Unload(Cancel As Integer)
Hide

End Sub

If you need anymore info, email me at:
covcat@riverstonegrp.com
I'll be glad to help you.
Cathy

by miss kitty

sorry, I just reread your question again and saw that you want to call crystal from access not from VB. I don't know if this can be done. I know that you can link to an access database when you set up a crystal report but not the other way.
Cathy

by fernstar

WHY WOULD YOU?
Access has a report gerator as good if not better than Crystal Reports!

Use the tool provided and save yourself time and effort.

This discussion is closed to new replies.