Q192302: HOWTO: Use GENHTML to Create HTML from a Visual FoxPro Table
Article: Q192302
Product(s): Microsoft FoxPro
Version(s): WINDOWS:6.0
Operating System(s):
Keyword(s):
Last Modified: 21-AUG-1999
-------------------------------------------------------------------------------
The information in this article applies to:
- Microsoft Visual FoxPro for Windows, version 6.0
-------------------------------------------------------------------------------
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 shows how to use the Genhtml.prg to create a tabbed HTML file from a
Visual FoxPro table or alias.
MORE INFORMATION
================
1. Create a program file named "Htmldbf.prg", using the following code:
* Generate HTML from a table without using it.
DO (_GENHTML) WITH "EXAMPLEA",HOME(2)+"DATA\CUSTOMER.DBF"
* Use the Employee table to generate from an alias.
USE HOME(2)+"DATA\EMPLOYEE" IN 0 ALIAS EMPL
* Generate HTML from an alias.
DO (_GENHTML) WITH "EXAMPLEB",'EMPL'
CLOSE ALL
public ohyperlinkobject
* Create a form with a hyperlink.
ohyperlinkobject=NEWOBJECT('hyperform',HOME()+"ffc\_hyperlink.vcx")
ohyperlinkobject.SHOW
DEFINE CLASS hyperform AS FORM
TOP = 0
LEFT = 0
HEIGHT = 100
WIDTH = 250
DOCREATE = .T.
CAPTION = "Display Example Tables"
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)+"\EXAMPLEA.HTM", ;
CAPTION = "Example Table A", ;
lnewwindow = .T., ;
NAME = "_HYPERLINKLABEL1"
ADD OBJECT _hyperlinklabel2 AS _hyperlinklabel WITH ;
LEFT = 25, ;
TOP = 60, ;
HEIGHT = 25, ;
VISIBLE = .T., ;
FONTNAME = "Times New Roman", ;
FONTSIZE = 14, ;
FONTITALIC = .T., ;
AUTOSIZE = .T., ;
ctarget = sys(5)+sys(2003)+"\EXAMPLEB.HTM", ;
CAPTION = "Example Table B", ;
lnewwindow = .T., ;
NAME = "_HYPERLINKLABEL2"
ENDDEFINE
* End Code
2. When the Form captioned "Display Example Table" displays, click the hyperlink
labels to display the HTML generated by GENHTML.
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:
Q185657 HOWTO: Utilize the Hyperlink Foundation Class
(c) Microsoft Corporation 1998, All Rights Reserved.
Contributions by John R. Desch, Microsoft Corporation
Additional query words: kbhtml kbVFp600 kbXBase kbInternet kbMiscTools
======================================================================
Keywords :
Technology : kbVFPsearch kbAudDeveloper kbVFP600
Version : WINDOWS:6.0
Issue type : kbhowto
=============================================================================
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.
Copyright Microsoft Corporation 1986-2002.