Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Crystal Report Designer for VB

Posted on 2002-06-20
8
Medium Priority
?
559 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
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!

 

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

721 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