Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Crystal Report Designer for VB

Posted on 2002-06-20
8
Medium Priority
?
560 Views
Last Modified: 2012-08-13
I Wish to print a report automatically from VB using CR ,

The code should be
CRViewer1.PrintReport

but it will only show up a print menu to let you press to
print from page to page.

What will be the parameter to pass in to let it printout automatically?

Also how to pass filed parameter to print a specify range of report?

I used to use the object of "Crystal report" and pass parameter through it.


Thanks very much.
0
Comment
Question by:sssssss
8 Comments
 
LVL 3

Accepted Solution

by:
Elmo_ earned 400 total points
ID: 7095233
sssssss,

To Print directly to the printer you will need to set the "Destination" property. And to select the range you will need to use the "PrinterStartPage" And "PrinterStopPage" properties.

Here are the details of these three properties along with examples:

---------------------------------------------------
Destination

Description

Specifies the destination to which your report is to be printed (Window, Printer, or File).

Runtime Usage
[form.]CrystalReport.Destination[= Destination%]
For example:
CrystalReport1.Destination = 0
     
«sends the specified report to a print window.»

Remarks
Select one of the following print destinations:
0      0 =Window (sends the report to a print window)     crptToWindow
1      1 =Printer (sends the report to a printer)     crptToPrinter
2      2 =File (prints the report to a disk file for printing at a later time or for importing into other applications. If you select this property, you will also have to set the PrintFileName and PrintFileType properties.)     crptToFile
3      3 =EMail via MAPI (sends the report to another person on your network via MAPI Email (Microsoft Mail). The report is attached to the EMail letter in the format specified by the PrintFileType property.)     crptMapi
     
Availability
Design time; Runtime
---------------------------------------------------

To Specify the Print Range you will need to use PrinterStartPage And PrinterStopPage.  
---------------------------------------------------
PrinterStartPage

Description

Sets the first page to be printed.
Runtime Usage
[form.]CrystalReport.PrinterStartPage[= StartPage%]
For example:
CrystalReport1.PrinterStartPage = 7
     
«Specifies that printing is to begin with page 7 of the report.»

Remarks
If a value less than or equal to 0 is used for PrinterStartPage, the value is ignored and printing starts with page 1.

Availability
Design time, Runtime


PrinterStopPage

Description
Sets the last page to be printed.

Runtime Usage
[form.]CrystalReport.PrinterStopPage[=StopPage%]
For example:
CrystalReport1.PrinterStopPage = 12
     
«Specifies that the printing is to end with page 12 of the report.»

Remarks
Use a value of -1 for PrinterStopPage to indicate that printing is to continue through to the last page.

Availability
Design time, Runtime
---------------------------------------------------

Hope this helps

Ed.
0
 
LVL 1

Expert Comment

by:Benjy
ID: 7095297
use:
reportname.PrintOut False, 1
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 7096430
listening
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Expert Comment

by:omarmallat
ID: 7098970
only use these two property to print a crystal file directly to printer:
    crp1.Destination = crptToPrinter
    crp1.Action = 1
0
 
LVL 3

Expert Comment

by:Elmo_
ID: 7173792
SSSSSSS,

Any update here? It hass been a month now.  Could you please close out this question?

Cheers,

Ed.
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7197479
sssssss,

A request has been made that a Moderator close this question, and our records show that you logged in within the last month or so.

Please accept the responsibility you agreed to when you joined Experts Exchange and resolve this question.

EXPERTS: Please leave your thoughts as to what should be done with this question (delete, PAQ, or award to an Expert) within the next seven (7) days. If the Asker does not respond within that time frame, I or another Moderator will close this question.

Netminder
CS Moderator
0
 
LVL 3

Expert Comment

by:Elmo_
ID: 7208654
Netminder,

I think that I should be awarded the points as I was the first to respond with a valid answer.

Cheers,

Ed.
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7209181
Agreed. Force-accepted.

Netminder
CS Moderator
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question