Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Crystal reports


Message #1 by "Amjad Saeed" <amjadsaeed@b...> on Sat, 15 Mar 2003 20:54:52 +0500
Hi Programmers,

Can i use Crystal Reportsin Access if yes then How to Call these reports I mean Open And Link

Hoping a better solution

Amjad Saeed


Message #2 by Paul Streeter <PStreeter@C...> on Sun, 16 Mar 2003 12:14:14 -0600
Yes. It's an active X call. The documentation is written from the VBA 
perspective and is hard to sort out. Several of the techies are also VBA 
only, but one gave me an example. I can send it to you tomorrow from my 
office. Which release are you useing?
Paul

Amjad Saeed wrote:
> Hi Programmers,
> 
> Can i use Crystal Reportsin Access if yes then How to Call these reports I mean Open And Link
> 
> Hoping a better solution
> 
> Amjad Saeed
> 
> 
> 
> 



Message #3 by "Amjad Saeed" <amjadsaeed@b...> on Mon, 17 Mar 2003 23:24:34 +0500
Dear Paul,

Thanks,

I will wait for ur mail

Amjad

----- Original Message -----
From: "Paul Streeter" <PStreeter@C...>
To: "Access" <access@p...>
Sent: Sunday, March 16, 2003 11:14 PM
Subject: [access] Re: Crystal reports


> Yes. It's an active X call. The documentation is written from the VBA
> perspective and is hard to sort out. Several of the techies are also VBA
> only, but one gave me an example. I can send it to you tomorrow from my
> office. Which release are you useing?
> Paul
>
> Amjad Saeed wrote:
> > Hi Programmers,
> >
> > Can i use Crystal Reportsin Access if yes then How to Call these reports
I mean Open And Link
> >
> > Hoping a better solution
> >
> > Amjad Saeed
> >
> >
> >
> >
>
>
>
>
>

Message #4 by "Paul G Streeter" <PStreeter@c...> on Mon, 17 Mar 2003 20:57:04
>From: "Amjad Saeed" <amjadsaeed@b...>  

>I will wait for ur mail

>From: "Paul Streeter" <PStreeter@C...>

>> Yes. It's an active X call. The documentation is written 
>>from the VBA perspective and is hard to sort out. Several of
>>the techies are also VBA only, but one gave me an example. I
>>can send it to you tomorrow from my office. Which release
are you using?

>> Amjad Saeed wrote:

>> > Can i use Crystal Reportsin Access if yes then How to
Call >> > these reports I mean Open And Link.

Amjad & Beth:

I am describing this in terms of Crystal Reports Version 9. It
was different in earlier versions. (Version 8 supported the
old way but introduced the new one.) It's a mite on the
cookbook side, as my understanding is barely adequate to do
it. If someone can improve on it, please do so.

1. Create a form not associated with any table or query.

2. Click the "more controls" button and select "Crystal Report
Viewer Control 9." If it's not available, you need to go back
to the installation process for Crystal Reports and install it. 
The data properties of the control will be "OLE class 
Crystal Report Viewer Control 9" , "Class 
CRViewer9.CRViewer.9.2" , and "enabled = yes."
3. Place the control in the upper left corner of the form.
4. Before saving the form the first time, maximize the form
and control and stretch them to the largest size you will
want. (Access won't let you do this later.)
5. To the load and unload events for the form, add the following:

Dim crxApplication As New CRAXDRT.Application
Dim crxReport As CRAXDRT.Report

Private Sub Form_Load()
'Use the fully qualified path to the report in the next line.
Set crxReport = crxApplication.OpenReport("D:\path\report.rpt")

CRViewer1.ReportSource = crxReport
CRViewer1.ViewReport
CRViewer1.EnableExportButton = True

While CRViewer1.IsBusy
 DoEvents
Wend

End Sub

Private Sub Form_Unload(Cancel As Integer)
    Set crxReport = Nothing
End Sub

Opening the form will call Crystal Reports to generate the
report and make it available for preview. The line about the
export button is there because I really like Crystal Reports'
ability to export to a pdf (Adobe Acrobat file.) 

If your development and end user machines do not all have the
same version of Windows, there will be dll version
considerations, but that is another letter.

Good luck with this. I hope it is helpful.

Paul
Message #5 by Beth Moffitt <BethMoffitt@i...> on Mon, 17 Mar 2003 15:04:43 -0600
Thanks for the info.  Now I have a really stupid question.

Can you use Crystal for viewing reports created in MS Access?  Say I have an
Access Report in my mdb and I want to activate Crystal Reports from my
database to view this Access report.  Don't ask why, but there is a user
reason, not that it's a good one, but there is one.  

Is it possible to do this that anyone is aware of?

Beth 


-----Original Message-----
From: Paul G Streeter [mailto:PStreeter@c...] 
Sent: Monday, March 17, 2003 2:57 PM
To: Access
Subject: [access] Re: Crystal reports

>From: "Amjad Saeed" <amjadsaeed@b...>  

>I will wait for ur mail

>From: "Paul Streeter" <PStreeter@C...>

>> Yes. It's an active X call. The documentation is written 
>>from the VBA perspective and is hard to sort out. Several of
>>the techies are also VBA only, but one gave me an example. I
>>can send it to you tomorrow from my office. Which release
are you using?

>> Amjad Saeed wrote:

>> > Can i use Crystal Reportsin Access if yes then How to
Call >> > these reports I mean Open And Link.

Amjad & Beth:

I am describing this in terms of Crystal Reports Version 9. It
was different in earlier versions. (Version 8 supported the
old way but introduced the new one.) It's a mite on the
cookbook side, as my understanding is barely adequate to do
it. If someone can improve on it, please do so.

1. Create a form not associated with any table or query.

2. Click the "more controls" button and select "Crystal Report
Viewer Control 9." If it's not available, you need to go back
to the installation process for Crystal Reports and install it. 
The data properties of the control will be "OLE class 
Crystal Report Viewer Control 9" , "Class 
CRViewer9.CRViewer.9.2" , and "enabled = yes."
3. Place the control in the upper left corner of the form.
4. Before saving the form the first time, maximize the form
and control and stretch them to the largest size you will
want. (Access won't let you do this later.)
5. To the load and unload events for the form, add the following:

Dim crxApplication As New CRAXDRT.Application
Dim crxReport As CRAXDRT.Report

Private Sub Form_Load()
'Use the fully qualified path to the report in the next line.
Set crxReport = crxApplication.OpenReport("D:\path\report.rpt")

CRViewer1.ReportSource = crxReport
CRViewer1.ViewReport
CRViewer1.EnableExportButton = True

While CRViewer1.IsBusy
 DoEvents
Wend

End Sub

Private Sub Form_Unload(Cancel As Integer)
    Set crxReport = Nothing
End Sub

Opening the form will call Crystal Reports to generate the
report and make it available for preview. The line about the
export button is there because I really like Crystal Reports'
ability to export to a pdf (Adobe Acrobat file.) 

If your development and end user machines do not all have the
same version of Windows, there will be dll version
considerations, but that is another letter.

Good luck with this. I hope it is helpful.

Paul
Message #6 by "Michael.Stalford" <michael.stalford@c...> on Tue, 18 Mar 2003 15:08:33 -0700
Paul,
	I was watching the thread it this worked like a champ.  Is there
a way to pass the parameter in the open report method?  I don't the user
to see the parameter window that crystal pops up.

TIA,
Mike

-----Original Message-----
From: Paul G Streeter [mailto:PStreeter@c...] 
Sent: Monday, March 17, 2003 8:57 PM
To: Access
Subject: [access] Re: Crystal reports

>From: "Amjad Saeed" <amjadsaeed@b...>  

>I will wait for ur mail

>From: "Paul Streeter" <PStreeter@C...>

>> Yes. It's an active X call. The documentation is written 
>>from the VBA perspective and is hard to sort out. Several of
>>the techies are also VBA only, but one gave me an example. I
>>can send it to you tomorrow from my office. Which release
are you using?

>> Amjad Saeed wrote:

>> > Can i use Crystal Reportsin Access if yes then How to
Call >> > these reports I mean Open And Link.

Amjad & Beth:

I am describing this in terms of Crystal Reports Version 9. It
was different in earlier versions. (Version 8 supported the
old way but introduced the new one.) It's a mite on the
cookbook side, as my understanding is barely adequate to do
it. If someone can improve on it, please do so.

1. Create a form not associated with any table or query.

2. Click the "more controls" button and select "Crystal Report
Viewer Control 9." If it's not available, you need to go back
to the installation process for Crystal Reports and install it. 
The data properties of the control will be "OLE class 
Crystal Report Viewer Control 9" , "Class 
CRViewer9.CRViewer.9.2" , and "enabled = yes."
3. Place the control in the upper left corner of the form.
4. Before saving the form the first time, maximize the form
and control and stretch them to the largest size you will
want. (Access won't let you do this later.)
5. To the load and unload events for the form, add the following:

Dim crxApplication As New CRAXDRT.Application
Dim crxReport As CRAXDRT.Report

Private Sub Form_Load()
'Use the fully qualified path to the report in the next line.
Set crxReport = crxApplication.OpenReport("D:\path\report.rpt")

CRViewer1.ReportSource = crxReport
CRViewer1.ViewReport
CRViewer1.EnableExportButton = True

While CRViewer1.IsBusy
 DoEvents
Wend

End Sub

Private Sub Form_Unload(Cancel As Integer)
    Set crxReport = Nothing
End Sub

Opening the form will call Crystal Reports to generate the
report and make it available for preview. The line about the
export button is there because I really like Crystal Reports'
ability to export to a pdf (Adobe Acrobat file.) 

If your development and end user machines do not all have the
same version of Windows, there will be dll version
considerations, but that is another letter.

Good luck with this. I hope it is helpful.

Paul

Message #7 by Paul Streeter <PStreeter@C...> on Tue, 18 Mar 2003 20:25:51 -0600
Michael.Stalford wrote:
> Paul,
 > 	I was watching the thread it this worked like a champ.  Is there
 > a way to pass the parameter in the open report method?  I don't want 
the user to see the parameter window that crystal pops up.
 >
You are experiencing something I haven't. Can you describe it with more 
detail?

Paul


Message #8 by "Michael.Stalford" <michael.stalford@c...> on Tue, 18 Mar 2003 19:11:34 -0700
Paul,
	I figured it out.  I was using an activeX control to display a
crystal report.  I wasn't sure how to populate a parameter for the
report in VBA instead of having it prompt the user.  I used the
setcurrentvalue method of the parameterfields collection.  It worked
like a champ.
	I tried using the object browser, but there wasn't a help file
to show examples, so I searched the web.

Thanks,
Mike


-----Original Message-----
From: Paul Streeter [mailto:PStreeter@C...] 
Sent: Tuesday, March 18, 2003 7:26 PM
To: Access
Subject: [access] Re: Crystal reports

Michael.Stalford wrote:
> Paul,
 > 	I was watching the thread it this worked like a champ.  Is there
 > a way to pass the parameter in the open report method?  I don't want 
the user to see the parameter window that crystal pops up.
 >
You are experiencing something I haven't. Can you describe it with more 
detail?

Paul





  Return to Index