Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

printing crystal reports from Access forms 1

Status
Not open for further replies.

Delboy14

Programmer
Jun 21, 2001
213
GB
Access 2002 & Crystal Reports 8.5

I know how to open a Crystal report from a command button, but how do I print a report, and how do I include the selection criteria?

I have a report template in crystal, which is a doctors practice report. I have a form in access which displays each day which practices are due a report, I would like to have a button under the list of practices which will print a report for each practice in this list, using the practice name for the selection criteria. Does anyone know how to do this in the access form?
 
I don't know much about MS Access programming, but I have heard that is very similar to VB. Have you tried the equivalent VB commands? Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
In Access when you are typing the code for the macro, it is in a visulal basic enviroment, so the relevant vb commands will work, do you know what they are?

if so, I need to specify to print a Crystal report, and include the selection criteria (if this can be done).

the reports I have to produce are for audits on doctors practices (may sound familiar), the selection criteria for the reports, is select where PracticeName ="Name". I have a query in my database which lists the practices, due a report that day, called DueToday. I would like to use vb code simmilar to the pseudo code below, to try and produce the desired result:

for(i=PracticeID, i!=0, i++)
{
printCrystalReport(c:\PracticeReport.rpt)
SelectionCriteria(=PracticeName)
}

which would print out the reports for each practice in the query. I know the code is flawed above it was just to try and give you an idea of what I am trying to do.

Could you give me an idea on how this could be done the relevant commands etc. thankyou for your help
 
CR has 4 integration methods, each with different syntax. Do you know which you are using? Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
No, sorry I do not. The syntax I am using to open the report in VB is this:

Dim stAppName As String

stAppName = "C:\Program Files\Seagate Software\Crystal Reports\crw32.exe C:\Derek\Reports\Database\Page20-graph.rpt"

Call Shell(stAppName, 1)

if that is any help?
 
Opening the report is different from integrating the report. If you open it using CRW32 (the report designer), then you have to do everything in the report designer. To manipulate it from commands you have to use an integration method. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
I went away and read up on Integration methods, I bought the proffesional edition of Crystal Reports 8.5 so did not get the RDC application. I have downloaded the 30 day trial version to see if I can do what I require, if it I can I will buy it. thanks for your help again.

I do want to manipulate the report from commands, an from what I have read RDC seems the best way?
 
I'm not familiar with Access 2000, however, here's some documentation from Crystal Decisions that may prove useful.


Instead of calling the report writer, why not embed the Crystl32.ocx in your form. You can then modify the properties of the ActiveX component via the gui or in VBA.
 
That is Crystal's line, and the one they WANT everyone to use. However, many programmers don't like the fact that you have to refer to everything by number. VB still comes with a free copy of CR4.6 and the OCX for free so it is widely used. The RDC can do the most sophisticated control. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top