Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old September 8th, 2004, 05:36 AM
Registered User
 
Join Date: Sep 2004
Location: são paulo, são paulo, Brazil.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to saadeh
Default Data report

I can set a different printer to a data report using method ".printreport false"?

  #2 (permalink)  
Old September 8th, 2004, 06:03 AM
Friend of Wrox
 
Join Date: Jul 2004
Location: , , India.
Posts: 345
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to gokul_blr Send a message via Yahoo to gokul_blr
Default

http://support.microsoft.com/default...en-us%3B319034

  #3 (permalink)  
Old September 8th, 2004, 06:10 AM
Friend of Wrox
 
Join Date: Jul 2004
Location: , , India.
Posts: 345
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to gokul_blr Send a message via Yahoo to gokul_blr
Default

Printing Reports
There are four methods provided for printing the report:

printReport ( )
printReport (Object printJob, Object pageFormat, boolean bInteractive, boolean bInBackground, boolean bUseJDK11)
printReport (Object printJob, Object pageFormat, boolean bInteractive, boolean bInBackground, boolean bUseJDK11, boolean bSeparateLargePage)
printReport (Object printJob, Object pageFormat, boolean bInteractive, boolean bInBackground,
boolean bUseJDK11, boolean bSeparateLargePage, String jobName)
printReport (Object printJob, Object pageFormat, boolean bInteractive, boolean bInBackground,
boolean bUseJDK11, boolean bSeparateLargePage, String jobName, String printer)
getPrintStatus ( )
Parameters:

printJob -- The job of this printing.
pageFormat -- Description for the size and orientation of a page to be printed.
bInteractive -- A boolean value. If you set it to false, the print setup dialog will not show up.
bInBackground -- A boolean value. If you set it to true, the printing dialog will not show up.
bUseJDK11 -- A boolean value. If you set it to true, it will use JDK1.1.x to print the report. Otherwise if you set false, it will use the JDK which you are running to print the report. The JDK 1.1 printing method is quick in speed but the printing quality is not guaranteed. The JDK 1.2 method can give you a satisfactory result, even for a gif file, but it is slow in speed.
bSeparateLargePage -- A boolean value, if the report page size is larger than the print paper size, and you want to separate the large report page during printing, you should set this property to true. If the print page size which you choose is less than the report page size, then the report will be printed as multiple pages serially, this means we will separate the large page of the report automatically. After you set it to true, for JDK1.2 or higher, the page format dialog will be popped up. In this dialog, you can choose the page format which you want to print with, we will use this page size for printing. For JDK1.1.x, however, you must change the page format which you want to print with in the print dialog (click the property button, then choose the page format).
jobName -- A String value of the job name. When printing, the job name you defined will list in the window which shows information, such as the status of documents and the owner of a document etc.
printer -- The name of the printer used to print the report. Please note that if you set bUseJDK11 to be false, you can't set printer but use the default printer only.
Note:

The first method printReport ( ) is called to start printing. It will take the third method using the default parameter values like this:
printReport(null, null, true, false, false, false)
The second and third method allows you to pass the parameters -- printJob, pageFormat, bInteractive, bInbackground, bUseJDK11 and bSeparateLargePage.
The third printing method (with the bSeparateLargePage parameter) is not recommended, it may cause some unexpected errors, for example, you may get an extra blank page.
After printing is started, the method getPrintStatus ( ) can be used to get the print job status. Returned values of getPrintStatus ( ) are:
"No print job"
"Busy"
"OK"
"No report load"
Other error messages if there are errors.
Example1: Under JDK1.2 or higher, if you use JDK1.2 printing method (boolean bUseJDK11), you can call the printReport method like this:
PrinterJob printJob = PrinterJob.getPrinterJob();
bean.printReport(printJob, printJob.defaultPage(), false, false, false);
Or, if you do not want to getPrinterJob, simply call:
bean.printReport(null, null, false, false, false);

Example2: Under JDK1.2 or higher, if you use JDK1.1 printing method, you are best recommended not to getPrintJob, just call:
bean.printReport(null, null, false, false, true);

Example 3: Under JDK 1.2 or higher, if you use JDK1.1 printing method and select a network printer, you can call the printReport method like this:
bean.printReport(null, null, false, false, true, false, "job1", "\\\\GUOF\\HP LaserJet 6L Pro PCL5e");

Example 4: Under JDK 1.2 or higher, if you use JDK1.1 printing method and select a local printer, you can call the printReport method like this:
bean.printReport(null, null, false, false, true, false, "job1", "HP LaserJet 6L Pro PCL5e");


  #4 (permalink)  
Old September 8th, 2004, 06:11 AM
Friend of Wrox
 
Join Date: Jul 2004
Location: , , India.
Posts: 345
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to gokul_blr Send a message via Yahoo to gokul_blr
Default

The Examples are showing the JDK / Can u check at the parameter supported by VB


  #5 (permalink)  
Old September 8th, 2004, 07:11 AM
Registered User
 
Join Date: Sep 2004
Location: são paulo, são paulo, Brazil.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to saadeh
Default

:Dthanks man!!! let me see if works

  #6 (permalink)  
Old September 8th, 2004, 08:14 AM
Registered User
 
Join Date: Sep 2004
Location: são paulo, são paulo, Brazil.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to saadeh
Default

How i use this JDK1.2? Because i install service pack 6 for visual basic6 and try to use method printreport again. the properties remains the same "object.PrintReport(ShowDialog, Range, PageFrom, PageTo)"

regards,

Saadeh



Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Report kumaran_21cen VB Components 1 April 27th, 2007 10:16 AM
How to edit report data after previewing report twt Access VBA 2 April 14th, 2005 06:35 AM
data environment in data report- error?Why myth12345 VB How-To 0 February 18th, 2005 03:08 AM
Data Report GerardMcL Pro VB Databases 1 October 7th, 2004 12:31 PM
VB6 Data Report (without data environment) woodie100 Beginning VB 6 1 April 15th, 2004 09:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.