Viewing Crystal 2008 ActiveX on Access 2007 forms
Ok, i am a little confused as there seems to be a some doubt whether Crystal 2008 ActiveX can be used on Access forms. Another thread even has a reply that mentions that the ActiveX control is no longer included in Crystal Reports 2008..... Take a look at this, you can clearly see i have embedded the 2008 ActiveX control onto an Access form. link:[http://www.moktar.pwp.blueyonder.co.uk/AX.JPG]
I have just installed 2008 and will get round to looking at this, however in my brief look, i couldnt see the run time library for 2008. By all accounts you can freely distribute the run time files for Crystal Reports 2008 as MSI or exe packages to your clients. I hope this is the case and i can get the ActiveX working.
If anyone has some information on this subject i will welcome reading it.
This is how its used to be done;
1) Open the Access form in design view.
2) Click on Add Tool button on the toolbar.
3) Select Crystal Reports ActiveX toolbar control from the list of controls.
4) Place the control on the form.
5) Click on the View Code toolbar button to open the code for the form
6) Choose u2018Referencesu2019 from the u2018Toolsu2019 menu
7) Select u2018Crystal Reports ActiveX Design and Runtime Library 11.Xu2019 from the list of references and add to the project.
8) On the Form_Load() event, please use the code given below to pass the report to the viewer:
Dim crReport as CRAXDRT.Report
Dim crApplication as New CRAXDRT.Application
u2018 Use the appropriate path for the report
Set crReport = crApplication.OpenReport(u201CC:\Report1.rptu201D)
u2018 ReportSource property and ViewReport method will not be displayed on the viewer control
CrystalActiveXReportViewer0.ReportSource = crReport
'Hey Presto, the Crystal control on the Access form is now displaying a report. However, you had the age old issue of distributing the runtime files to clients that dont have crystal reports installed, and even more so of an issue, as this is Access and no method of doing it. I was hoping that 2008 with its MSI and EXE versions of the runtime files would solve this age old problem.