Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Hilmar's TextReport
Message
From
19/10/2006 19:15:31
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
19/10/2006 13:03:44
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01163220
Message ID:
01163508
Views:
10
>I have tried to print out from Command Windows:
>
>SET PRINTER TO NAME EPSON1
>??'test1'
>SET PRINTER TO NAME EPSON2
>??'test2'
>
>and it did direct to the right printer.
>
>but while I tried the samething in the report class: myclasses.ctextreport.print
>
>SET PRINTER TO NAME EPSON1
>?? lxText
>
>it always goes to default printer (not EPSON1)
>
>is there anything I should consider?

OK, I had forgotten some details about how my class works, so I had to look at the source code again.

I notice that my class sets the printer as follows.

In program main.prg, there is the line:
gcCurrentPrinter = set("printer",2)	&& default = windows default printer
And in file MyFunctions.prg (actual printing is done by function PrintTextFile()), there is the line:
set printer to name (gcCurrentPrinter)
(There is also another line that will reset the printer to the default.)

So, of course, this will override any SET PRINTER you specify before running the class.

The solution I recommend is to assign another value to the variable, gcCurrentPrinter.

Another alternative is to comment (disable) the two SET PRINTER commands in MyFunctions.prg.

>btw, TextReport really is a great tools and a great help for me.

Great, I am happy that some use it.

Note that it also provides a wrapper for Excel output.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform