Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detecting Windows Default Printer
Message
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00216227
Message ID:
00216287
Views:
27
>>Is there any way of Detecting Windows Default Printer?
>>
>>(BTW - I'm using NT)
>>
>>I have an app that sometimes prints wrong...but I noticed that if I toggle my default printer to something else, and then back to the original, then it prints correctly.
>>
>>What I'm doing is printing a report with multiple graphs. The graphs are produced using Graphics Server. To get things the way we want them we play with the FRX. Because of this, we have a "template" of the report, which we copy and modify. Part of the modification is to insert a record for each graph. Each report is uniquely re-named during the copy of the template. Each graph is stored as a BMP and is also uniquely named.
>>
>>So if I do two reports (A and B), I'll have at least three graphs each (G1a, G2a, G3a, and G1b, G2b, and G3b)... Each Graph is the result of an independant call to Graphics Server...
>>I should get the following:
>>Report A with Graphs G1a, G2a, G3a
>>Report B with Graphs G1b, G2b, G3b
>>
>>
>>Sometimes, if I don't toggle the default printer I'll get
>>Report A with Graphs G1a, G2a, G3a
>>Report B with Graphs G1a, G2a, G3a
>>
>>But if I do toggle the default printer I'll get
>>Report A with Graphs G1a, G2a, G3a
>>Report B with Graphs G1b, G2b, G3b
>>....Like I'm supposed to!
>>
>>We've checked everything "we" can think of and toggling the printer is the only thing that has worked so far...
>>...No, we don't know why it works
>>...No, we don't know why it prints wrong either.... :(
>>(I believe the FRX has the right entries...I'll double check)
>>
>>So that's why I'm asking,
>>Is there any way of Detecting Windows Default Printer?
>>
>>BTW - I'm told the info is in the NT Registry...how can I get there with 2.6? Any working solution is GREAT!!!! If you have an answer that doesn't involve the registry Please tell me! Don't hold back!
>
>
>If you are always trying to print to the default printer, you should be able to do this:
>
>Open your .FRX file like a table (USE myreport.FRX)
>For the first record, you should blank the EXPR, TAG, TAG2 memo fields.
>
>Now, when you try to run the report, it should go to the default printer.

(At least according to the posting section we're in) we're talking FPW 2.6 here. If so, EXPR doesn't have printer driver stuff in it. Only TAG and TAG2 do. Also, in FPW 2.6, if you blank out TAG and TAG2, you lose things like Landscape setting.

VFP is much nicer, settings like Landscape and paper size are stored in an easily recognizable text form in EXPR, and you can leave that in there while removing just the printer name and other printer-specific lines.

If someone knows of a way to take out the printer-specific stuff in FPW 2.6 and leave behind such things as Landscape orientation, I'd love to know it. I could use it at my current client's, where I'm doing Y2K remediation on a legacy FPW 2.6 app. (No, they won't upgrade to VFP.)

- Rich.
Rich Addison, Micro Vane, Inc., Kalamazoo, MI
Relax, don't worry, have a homebrew.
- Charlie Papazian, The New Complete Joy of Home Brewing
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform