Crystal Reports?

A

Andrew Gabb

I need to use Crystal Reports as the main reporting tool for an
Access application. (Not my choice - the client prefers CR because
they can then easily write their own reports regardless of the back
end. I don't have a problem with that.)

However, I can't see how to launch the CR report from Access,
including passing parameters. I can see some CR ActiveX controls,
but not the CrystalReport control I was looking for. I'm using CR 10
and Access XP.

I know I could launch the report using a Shell command, but this
still leaves the problem of passing the parameters (particularly in
a multiuser environment).

Any clues? Detailed advice would be even better.

The CR controls I can see are:
Crystal ActiveX Report Viewer Control 10.0
Crystal Enterprise Tree Control
Crystal Print Control 10.0
Crystal Repository Explorer Control 10.0

Andrew
 
C

Craig Hornish

Hi,
Since no one else has responded yet I will give you what I found when I
was working with this situation. It has been a while since I have used this
(version 8.5) but don't think things changed much.
This first link is for Knowledge base where you can do the searches I
did. As shown in brackets[]
http://support.businessobjects.com/search/default.asp

This is the [Runtime File requirements] for the Report Designer
componenets for version 9
http://support.businessobjects.com/library/kbase/articles/c2012421.asp
Looks like you have the Crystal Reports View Control CRViewer.dll but
may need the Active X Desighner and Design and runtime DLL craxdrt9.dll
(don't know if they have 10) but I was on an earlier version myself and used
this.

I got some help in what I could do by lookin at this articles on
[Migrating from the OCX] to the the Crystal Reports 9 Report Designer
Component(RDC)
http://support.businessobjects.com/communityCS/TechnicalPapers/cr9_ocx_to_rdc.pdf

In my case I opened a form where I could look up store numbers and then
print the report that was already designed for an acknowledement.

Basically:
At form module level
Dim objCR as New CRAXDRT.Application
Dim crReport as CRAXDRT.Report.

In the on open for form
Dim crxDatabaseTable as CRAXDRT.DatabaseTable
Set crReport = objCR.Openreport("path/filename",1)

After the Store number was updated I had to change some thing
For Each crxDatabaseTable in crReport.Database.Tables 'Can't remember why I
needed to do this it might have
crxDataabaseTable.Location ] "path\Filename.mdb"
Next crxDatabaseTable
crReport.ParameterFields.Item(1).AddCurrentValue ([me.StoreNumber])

Then I just opened the form that had the ActiveX Control for Crystal View on
it.
Form_Load
CRVIEWER1.ReportSource = Forms![frmStores].crReport
CRVIEWER1.EnableGroupTree = False 'the side pane
CRVIEWER1.viewReport
CRVIEWER1.enableExportButton = True

For the control itself on the form_resize
crviewer1.Height = InsideHEiaght
crviewer1.width = InsideWidth

Well that should give you the basics to start, I didn't delve into it much
more than that.
Hope it helps

Craig Hornish
 
A

Andrew Gabb

Thank you, thank you, thank you. This was just the stuff I needed.
For 10 the DLL is CRAXDDRT, which you need to register as a
reference in VBA, but the rest more or less follows. I also found
the TechRef.pdf (documenting the RDC) very useful, once I found it.

Have you any idea how to launch CR stand-alone (with parameters)
rather than in an Access viewer?

Andrew

Craig said:
Hi,
Since no one else has responded yet I will give you what I found when I
was working with this situation. It has been a while since I have used this
(version 8.5) but don't think things changed much.
This first link is for Knowledge base where you can do the searches I
did. As shown in brackets[]
http://support.businessobjects.com/search/default.asp

This is the [Runtime File requirements] for the Report Designer
componenets for version 9
http://support.businessobjects.com/library/kbase/articles/c2012421.asp
Looks like you have the Crystal Reports View Control CRViewer.dll but
may need the Active X Desighner and Design and runtime DLL craxdrt9.dll
(don't know if they have 10) but I was on an earlier version myself and used
this.

I got some help in what I could do by lookin at this articles on
[Migrating from the OCX] to the the Crystal Reports 9 Report Designer
Component(RDC)
http://support.businessobjects.com/communityCS/TechnicalPapers/cr9_ocx_to_rdc.pdf

In my case I opened a form where I could look up store numbers and then
print the report that was already designed for an acknowledement.

Basically:
At form module level
Dim objCR as New CRAXDRT.Application
Dim crReport as CRAXDRT.Report.

In the on open for form
Dim crxDatabaseTable as CRAXDRT.DatabaseTable
Set crReport = objCR.Openreport("path/filename",1)

After the Store number was updated I had to change some thing
For Each crxDatabaseTable in crReport.Database.Tables 'Can't remember why I
needed to do this it might have
crxDataabaseTable.Location ] "path\Filename.mdb"
Next crxDatabaseTable
crReport.ParameterFields.Item(1).AddCurrentValue ([me.StoreNumber])

Then I just opened the form that had the ActiveX Control for Crystal View on
it.
Form_Load
CRVIEWER1.ReportSource = Forms![frmStores].crReport
CRVIEWER1.EnableGroupTree = False 'the side pane
CRVIEWER1.viewReport
CRVIEWER1.enableExportButton = True

For the control itself on the form_resize
crviewer1.Height = InsideHEiaght
crviewer1.width = InsideWidth

Well that should give you the basics to start, I didn't delve into it much
more than that.
Hope it helps

Craig Hornish

I need to use Crystal Reports as the main reporting tool for an Access
application. (Not my choice - the client prefers CR because they can then
easily write their own reports regardless of the back end. I don't have a
problem with that.)

However, I can't see how to launch the CR report from Access, including
passing parameters. I can see some CR ActiveX controls, but not the
CrystalReport control I was looking for. I'm using CR 10 and Access XP.

I know I could launch the report using a Shell command, but this still
leaves the problem of passing the parameters (particularly in a multiuser
environment).

Any clues? Detailed advice would be even better.

The CR controls I can see are:
Crystal ActiveX Report Viewer Control 10.0
Crystal Enterprise Tree Control
Crystal Print Control 10.0
Crystal Repository Explorer Control 10.0

Andrew
--
Andrew Gabb
email: (e-mail address removed) Adelaide, South Australia
phone: +61 8 8342-1021, fax: +61 8 8269-3280
-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top