Article ID: 191927 - Last Review: July 13, 2004 - Revision: 1.1

HOWTO: Use GENHTML to Create HTML from a Visual FoxPro Report

This article was previously published under Q191927
Expand all | Collapse all

SUMMARY

Genhtml.prg is a Hypertext Markup Language (HTML) generation program that ships with Visual FoxPro 6.0. When executed, the Genhtml.prg creates a text file that contains a hypertext markup language version of a form, menu, report, or table. The Genhtml.prg is executed when the "Save as HTML" option is selected from the File menu.

This article demonstrates how to use the Genhtml.prg file to create a tabbed HTML file from a Visual FoxPro report.

MORE INFORMATION

  1. Create a program file named Htmlrepo.prg containing the following code:
          USE HOME(2)+"DATA\CUSTOMER"
          CREATE REPO EXAMPLE FROM CUSTOMER
          CLOSE ALL
          DO (_GENHTML) WITH "EXAMPLE","EXAMPLE.FRX"
          CLOSE ALL
    
          * Set the class library to the _hyperlink class
          SET CLASSLIB TO home()+"ffc\_hyperlink.vcx"
          public ohyperlinkobject
          * Create a form with a hyperlink
          ohyperlinkobject=CREATEOBJECT('hyperform')
          ohyperlinkobject.SHOW
    
          DEFINE CLASS hyperform AS FORM
             TOP           = 0
             LEFT          = 0
             HEIGHT        = 75
             WIDTH         = 250
             DOCREATE      = .T.
             CAPTION       = "Display Example Report"
             NAME          = "Form1"
             SHOWTIPS      = .T.
    
             ADD OBJECT _hyperlinklabel1 AS _hyperlinklabel WITH ;
                LEFT       = 25, ;
                TOP        = 10, ;
                HEIGHT     = 25, ;
                VISIBLE    = .T., ;
                FONTNAME   = "Times New Roman", ;
                FONTSIZE   = 14, ;
                FONTITALIC = .T., ;
                AUTOSIZE   = .T., ;
                ctarget    = sys(5)+sys(2003)+"\EXAMPLE.HTM", ;
                CAPTION    = "Example Report", ;
                lnewwindow = .T., ;
                NAME       = "_HYPERLINKLABEL1"
    
          ENDDEFINE
          * End Code
    						
  2. When the Form captioned "Display Example Table" displays, click the hyperlink label to display the HTML generated by the GENHTML program.

REFERENCES

Visual FoxPro 6.0 Books Online: Programmer's Guide; Chapter 13 Compiling an Application.

For additional information, please see the following article in the Microsoft Knowledge Base:
185657  (http://support.microsoft.com/kb/185657/EN-US/ ) HOWTO: Utilize the Hyperlink Foundation Class
(c) Microsoft Corporation 1998. All Rights Reserved. Contributions by John Desch, Microsoft Corporation.

APPLIES TO
  • Microsoft Visual FoxPro 6.0 Professional Edition
Keywords: 
kbcode kbhowto KB191927
Retired KB ArticleRetired KB Content Disclaimer
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.
 

Article Translations