dbTalk Databases Forums  

VFP 9: Printing to more than one printer at once

comp.databases.xbase.fox comp.databases.xbase.fox


Discuss VFP 9: Printing to more than one printer at once in the comp.databases.xbase.fox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Gene Wirchenko
 
Posts: n/a

Default VFP 9: Printing to more than one printer at once - 10-02-2006 , 03:30 PM






Is it possible to have printing going to more than one printer at
a time?

I have some reports that will have to be printed both to Adobe
Distiller and to a hardcopy printer. These reports are written using
a report master class that uses set printer on and ?. This master
class also has an option for output to a form.

I see three alternatives:

1) Switch between printers each physical print method call. (There
are many of these for a typical report.) This would involve changing
my report master class only. I would like to do this, but when I use
set printer to name <printername>
to switch it starts a new print job each time.

2) Modify my report master class to print to a temporary file, then
feed that to each printer. This is not too big of a change, but there
are bound to be a few quirks. One is capturing changes to paper
orientation.

3) Rewrite each report to print the report once for each printer. So
much for abstraction.

Can 1 be done? It definitely is the smallest change.

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.

Reply With Quote
  #2  
Old   
Bernhard Sander
 
Posts: n/a

Default Re: VFP 9: Printing to more than one printer at once - 10-03-2006 , 05:07 AM






Hi Gene,

Quote:
Is it possible to have printing going to more than one printer at
a time?

I have some reports that will have to be printed both to Adobe
Distiller and to a hardcopy printer. These reports are written using
a report master class that uses set printer on and ?. This master
class also has an option for output to a form.

I see three alternatives:

1) Switch between printers each physical print method call. (There
are many of these for a typical report.) This would involve changing
my report master class only. I would like to do this, but when I use
set printer to name <printername
to switch it starts a new print job each time.

2) Modify my report master class to print to a temporary file, then
feed that to each printer. This is not too big of a change, but there
are bound to be a few quirks. One is capturing changes to paper
orientation.

3) Rewrite each report to print the report once for each printer. So
much for abstraction.

Can 1 be done? It definitely is the smallest change.
1) As you have already observed, each SET PRINTER TO ... starts a new printjob.
I don't know of a way in foxpro, to resume an ended printjob. AFAIK, you can't
start a second printjob without closing the first. Foxpro supports only one
print chanel at a time.

2) I think, it is not a good solution, since there are too many dependencies
with the printer drivers involved: paper size/orientation, fonts, colors,
positioning...
You could use a temporary file at an abstract level, to resolve these
dependencies at the time when copying to the printer. So, this copying must be
an active process, not simply moving some bytes from here to there.
But then you have something like your version 3, only at an intermediate level.

3) With foxpro commands, I think this is the best solution.
What is the problem with this solution? Open the first printer, do your report,
open the second printer, do your report again. The only thing to to: open
different printers. The report itself should be independent from the printer.
This should be very easy, even with ?/?? printing. But you should keep any
calculation, that is not related to reporting, off your report

4) You could fiddle around with WinApi, GDI and GDI+ calls to do what you want.
But this is a lot of work and it would not integrate with your ? approach.

Regards
Bernhard Sander


Reply With Quote
  #3  
Old   
Gene Wirchenko
 
Posts: n/a

Default Re: VFP 9: Printing to more than one printer at once - 10-03-2006 , 10:19 AM



Bernhard Sander <fuchs (AT) no (DOT) spam> wrote:

[snip]

Quote:
1) As you have already observed, each SET PRINTER TO ... starts a new printjob.
I don't know of a way in foxpro, to resume an ended printjob. AFAIK, you can't
start a second printjob without closing the first. Foxpro supports only one
print chanel at a time.
I do not think that there is one, but asked in case I was wrong.

Quote:
2) I think, it is not a good solution, since there are too many dependencies
with the printer drivers involved: paper size/orientation, fonts, colors,
positioning...
The only dependency that I have to worry about is orientation. My
reports are plain text: no colour, no bold, etc.

Quote:
You could use a temporary file at an abstract level, to resolve these
dependencies at the time when copying to the printer. So, this copying must be
an active process, not simply moving some bytes from here to there.
But then you have something like your version 3, only at an intermediate level.
It would stay in the report master class though.

Quote:
3) With foxpro commands, I think this is the best solution.
What is the problem with this solution? Open the first printer, do your report,
open the second printer, do your report again. The only thing to to: open
different printers. The report itself should be independent from the printer.
This should be very easy, even with ?/?? printing. But you should keep any
calculation, that is not related to reporting, off your report
What do you mean by calculation not related to reporting? My
most complex reports have quite a bit of calculation related to
reporting in them. They also are the ones that need to run under the
new regime. Other can wait.

Quote:
4) You could fiddle around with WinApi, GDI and GDI+ calls to do what you want.
But this is a lot of work and it would not integrate with your ? approach.
Yipe, yipe, yipe! That would be a big rewrite.

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.


Reply With Quote
  #4  
Old   
Bernhard Sander
 
Posts: n/a

Default Re: VFP 9: Printing to more than one printer at once - 10-03-2006 , 12:14 PM



Hi Gene

Quote:
2) I think, it is not a good solution, since there are too many dependencies
with the printer drivers involved: paper size/orientation, fonts, colors,
positioning...
The only dependency that I have to worry about is orientation. My
reports are plain text: no colour, no bold, etc.
Already this paper size/orientation will cause some headache. I don't know your
report and your printers, there may be other things that will make trouble.

Quote:
3) With foxpro commands, I think this is the best solution.
What is the problem with this solution? Open the first printer, do your report,
open the second printer, do your report again. The only thing to to: open
different printers. The report itself should be independent from the printer.
This should be very easy, even with ?/?? printing. But you should keep any
calculation, that is not related to reporting, off your report
What do you mean by calculation not related to reporting? My
most complex reports have quite a bit of calculation related to
reporting in them. They also are the ones that need to run under the
new regime. Other can wait.
Some calculations, that may be done only once per report, maybe
adding/subtracting amounts from accounts or the like. Since you execute the
report more than once those calculations should be done outside the report.

Regards
Bernhard Sander


Reply With Quote
  #5  
Old   
Bernhard Sander
 
Posts: n/a

Default Re: VFP 9: Printing to more than one printer at once - 10-06-2006 , 04:16 AM



Hi Vince

Quote:
Is it possible to have printing going to more than one printer at
a time?


I don't know if this is what you have in mind or not, but in VFP 9, in
Tools, Component gallery, Catelog, Samples, Solutions, Visual Foxpro
Solutions, New in Vfp9, (Gasp! Wheeze!) There is sample code for "Report to
several outputs simultaneously using a Report Listener."
With these listeners it is possible to output the Report to different targets
simultanously, such as one printer, some files (html, xls...).
But I don't see how to output to several printers simultanously.

Regards
Bernhard Sander


Reply With Quote
  #6  
Old   
Josh Assing
 
Posts: n/a

Default Re: VFP 9: Printing to more than one printer at once - 10-06-2006 , 06:29 PM



I would create an exe who's whole purpose is to take xml input and report and
dump it to a specific printer.

PrintRpt.exe <cXMLStream> <cReportFile> <cPrinterName>

then just spawn off 3 instances if youw anted to print to 3 different printers.


--- AntiSpam/harvest ---
Remove X's to send email to me.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.