BUG: The Object-Assisted Print Preview toolbar does not retain its settings in Visual FoxPro 9.0 Professional Edition (895278)



The information in this article applies to:

  • Microsoft Visual FoxPro 9.0 Professional Edition

SYMPTOMS

You preview a report in Microsoft Visual FoxPro 9.0 Professional Edition, and you use the Object-Assisted Reporting tools. The first time that you open the Report Preview toolbar, there are no text labels on the Report Preview toolbar. The Print button respects the AllowPrintFromPreview property setting of the preview container. If you close and then reopen the Print Preview toolbar by using the shortcut menu, the following problems occur:
  • The caption of the Print Preview toolbar changes.
  • Text labels appear on some of the toolbar controls.
  • The Print button does not respect the AllowPrintFromPreview property setting of the preview container.

RESOLUTION

You can use the following methods to address this problem:
  • You can directly fix the code and rebuild the Reportpreview.app file.

    You can do this because the source code for the Reportpreview.app file and all the Object-Assisted Reporting tools are included with Visual FoxPro 9.0. However, this method has a drawback. This method addresses the problem inside the Visual FoxPro 9.0 development environment. However, this method does not fix the Reportpreview.app file inside the redistributable file that is named Vfp9rptapps.msm. The Vfp9rptapps.msm file is used when distributing Visual FoxPro 9.0 applications by using InstallShield Express Visual FoxPro Limited Edition. The Vfp9rptapps.msm file contains the Visual FoxPro 9.0 Object-Assisted Reporting tools. This includes a copy of the Reportpreview.app file that has the problem.
  • You can use the Preview Extension Handler as a better way to fix this problem.

    The Preview Extension Handler lets you modify the functionality or extend the functionality of the preview user interface without subclassing the source code or recompiling the source code. The Preview Extension Handler includes a set of "hook methods" that let you run Visual FoxPro 9.0 code in response to certain events during a Visual FoxPro 9.0 Object-Assisted report preview.
For more information about how to use a Preview Extension Handler to work around this problem, click the following article number to view the article in the Microsoft Knowledge Base:

895279 How to prevent printing from a report preview in Visual FoxPro 9.0

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

Steps to reproduce the problem

  1. Run the following code sample from a program in Visual FoxPro 9.0.
    SET REPORTBEHAVIOR 90
    REPORT FORM HOME() + 'Samples\Solution\Reports\colors.frx' PREVIEW
    
  2. If the Report Preview toolbar does not automatically open, follow these steps:
    1. Right-click the preview to open the Report Preview toolbar.
    2. On the menu, click Toolbar.
    3. Undock the toolbar.
    Notice the title of the Report Preview toolbar. There are no text labels on the title of the Report Preview toolbar.
  3. Click the Close button in the upper-right corner of the window to close the Report Preview toolbar.
  4. Right-click the preview, and then click Toolbar to reopen the Report Preview toolbar.

    Notice the Report Preview toolbar now. The title of the toolbar has changed. There are now text labels on some of the buttons. This may not seem to be a major problem. However, this lack of persistence also extends to other areas of the Report Preview toolbar. This includes removal of the Print button by using the AllowPrintFromPreview property setting of the preview container.

REFERENCES

For more information, see the "Leveraging the default preview container" section in the Visual FoxPro 9.0 online documentation at the following Microsoft Developer Network (MSDN) Web site:

Modification Type:MajorLast Reviewed:7/6/2005
Keywords:kbtshoot kbbug KB895278 kbAudDeveloper