How To Clear Report TAG, TAG2, and EXPR Fields Using .pjx Hooks This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
This article was previously published under Q257624 SUMMARY
Microsoft Visual FoxPro developers sometimes want to distribute reports without the worry of possible differences between the printer information contained in the report and the printer on the system where the report is going to run. The example in this article uses the Visual FoxPro project hooks to reset printer-specific information within all the reports in a project.
MORE INFORMATION
When you save a report in Visual FoxPro, the printer driver information and other print options are stored in the report table. To avoid any discrepancies, clear the printer information stored in the report before you distribute the application. This information is stored in the TAG, TAG2, and EXPR fields of the report. If you clear these fields, Visual FoxPro uses the system default printer to output the report. NOTE: The EXPR field also contains information about printer orientation, number of desired copies, and so forth. If your environment requires you to keep these settings, you should not clear this field. To do this, remark the line that reads:
Also, adjust the line previous to the EXPR field by removing the comma (,) and semi-colon (;) to complete the REPLACE command.If you do need to clear the values from the EXPR, you can store the information from the EXPR field into the USER Memo field, which has no effect on the report settings, and then replace it back to the EXPR when needed. Note this in the line of code:
The following code shows how to take advantage of Visual FoxPro project hooks to parse and reset the values of the TAG, TAG2, and EXPR fields on all reports contained in a specific project. The code assumes your reports are part of an existing project.
REFERENCESFor additional information on modifying Visual FoxPro reports, click the article numbers below
to view the articles in the Microsoft Knowledge Base:
133163 (http://support.microsoft.com/kb/133163/EN-US/) How To Control Printer Attributes for a Report at Run Time
138396 (http://support.microsoft.com/kb/138396/EN-US/) How To Use the Default Windows Printer in Visual FoxPro
(c) Microsoft Corporation 2000, All Rights Reserved. Contributions by Reinaldo Torrales, Microsoft Corporation.
| Article Translations
|


Back to the top
