Walter Meester
HoogkarspelNetherlands
General information
Category:
Reports & Report designer
Forio,
>Well, OK again, so I copy the report file to a temporary file, and manipulate the EXPR, TAG and TAG2 fields, changing the printer name to the desired one.
>This is sort of working, but I know that the actual printing is not going to be all right ALL OF THE TIME, because of differences in parameters between printer drivers.
When you clear the EXPR, TAG and TAG2 settings and set the printer with the SET PRINTER TO NAME command it should work fine because then it uses the default document properties for this printer.
one alternative but more complex route is to set the disired printer, create a quick report for a dummy table (with the CREATE REPORT report FROM Dummy), and copy the EXPR, TAG, TAG2 to your report. Optionally, you can change some of the document properties bij using the DocumentProperties API call and store the DEVMODE structure in the TAG2 fields. The only drawback with this option is that it only works for some (like orientation and papersize) properties. The other properties you set (like color and resolution) are reverted to the default settings.
>I figure you could use some API call to change the Windows Current Printer to another and then back to what it was, but I am not conversant with the API, nor I have access to MFC.
This can be done with one or more API calls. I don't remember the exact code, but i'm sure you can find this either here in the UT or the MS KB. Alhough this is a possibility i would not recommend this. If your program crashes before the printing ends (which is quite common because of some printer driver related problems), your default printer would be changed.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only