PRB: Printer Orientation & Settings Ignored by FoxPro for Mac

Last reviewed: May 21, 1996
Article ID: Q115773
The information in this article applies to:
  • Microsoft FoxPro for Macintosh, version 2.5b

SYMPTOMS

When a report is created in FoxPro version 2.5, 2.5a, 2.5b, or 2.6 for Windows and is then executed in FoxPro version 2.5b for Macintosh, FoxPro for Macintosh ignores the page orientation and other page layout settings. For example, if a report with landscape page orientation is created in FoxPro for Windows and then executed in FoxPro for Macintosh, the landscape setting will be ignored, and the report will be printed with portrait orientation.

CAUSE

The information used by the Macintosh operating system to describe the printer settings is an undocumented binary structure called a Tprint structure. Since the structure of this data is not documented by Apple and is subject to change at any time in the future, the Transporter program cannot create a new Macintosh Tprint structure from the data that is used to describe printer settings on a machine running the Microsoft Windows operating system.

RESOLUTION

According to article Q107824 in the Microsoft Knowledge Base, you can select the desired page orientation by opening the report and then choosing Page Layout from the Report menu. This is the recommended resolution to the problem.

However, because implementation of this suggestion requires the user to manually open and edit the report, this approach may not be desirable in all cases. For example, the Transporter may change the appearance of the report or you may need to port a large number of reports from FoxPro for Windows to FoxPro for Macintosh.

In cases where it is not practical or desirable to follow the instructions provided in article Q107824, you can use the following approach to cause the report to recognize the desired printer settings.

IMPORTANT: This approach is provided as a convenience for customers and is not supported by Microsoft. Please make a backup copy of your report files before modifying them on the Macintosh.

The resolution presented in this article is not compatible with System 7.0 of the Macintosh operating system. To implement the resolution presented below, you must have System 7.1 or later of the Macintosh operating system. Note also that the approach illustrated by this article may not solve all printing problems.

The structure of Tprint may be affected by the currently executing version of the Macintosh operating system, the hardware on which FoxPro is currently executing, or other factors. For this reason, you must create a Tprint structure on the machine where the report will be executed. If you follow this procedure, you should not modify a report on one machine, and then run that report on another machine. This procedure should be followed on the computer where this report will be executed.

The printer settings information for a report created in FoxPro for Windows is stored in the TAG and TAG2 fields of the first record of the .FRX file. The printer settings information for a report created in FoxPro for Macintosh is stored in the ORDER field of the first record of the .FRX file. The following instructions explain how to create a report in FoxPro for Macintosh that contains the desired print settings and then add the Tprint structure (which describes the desired print settings) to a report that was created in FoxPro for Windows. These instructions assume that the filename of the report created in FoxPro for Windows is WINRPT and the filename of the report created in FoxPro for Macintosh is MACRPT.

  1. Copy the report created in FoxPro for Windows to the Macintosh. The report should be placed in the default FoxPro for Macintosh subdirectory. If the report is placed in another directory, you must use the SET DEFAULT command to set the default directory to the directory containing the report or use an appropriate path to reference the report files.

  2. Load FoxPro for Macintosh.

  3. Create a simple database. For example, type the following in the Command window:

          CREATE TABLE small (fld C(2))
    

  4. Create a report by typing the following command in the Command window:

          CREATE REPORT macrpt
    

  5. Create a quick report by choosing Quick Report from the Report menu.

  6. Set the desired printer settings by choosing Page Layout from the Report menu. Choose the Page Settings button, make the desired selections, and then choose OK twice to close the dialog boxes.

  7. Save the report by choosing Save from the File menu. Do NOT save the environment information.

  8. Press the ESC key to close the Report Writer.

  9. Modify the report created in FoxPro for Windows by placing the following code in a .PRG file and then executing it:

          CLOSE ALL
          USE winrpt.frx IN 1
          USE macrpt.frx IN 2
          SELECT macrpt
          GOTO 1
          SELECT winrpt
          GOTO 1
    
          REPLACE tag   WITH ""
          REPLACE tag2  WITH ""
          REPLACE order WITH macrpt.order
          CLOSE ALL
    
    
The .FRX file for the report created in FoxPro for Windows has now been modified. The printer settings information specific to the Microsoft Windows operating system has been removed and the printer settings information specific to the Macintosh operating system has been added.

If the report is executed, it should now reflect the printer settings established in MACRPT.


Additional reference words: FoxMac 2.50b respect
KBCategory: kbprg kbprb kbcode
KBSubcategory:


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: May 21, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.