dcsimg
Login | Register   
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: Visual FoxPro
Expertise: Beginner
Sep 22, 2000

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


Printing a Report to a RTF or HTML File

Question:
Can you create a HTML or RTF file in Visual FoxPro? If so, how?

Answer:
VFP comes with a program (called GENHTML.PRG) that can generate HTML from many different sources: tables, reports, menus, forms, etc.

VFP keeps the name and path of this program in a system memory variable called _GENHTML. You can view the code by executing the following command from the command window:
MODIFY COMMAND (_GENHTML)

Here is the list of parameters for _GENHTML:

  • cOutFile: Specifies the name of the output .HTM file. If a filename without an extension is specified, .HTM is used.
  • vSource: Specifies the source filename, alias, or object (can pass the name of a table, screen, report, menu, or an object).
  • nShow:
    • 0/.F./Empty = Generate output file only
    • 1 = Create output file and view generated file
    • 2 = Create output file and show generated file in Internet Explorer
    • 3 = Create output file and show based on Save As HTML dialog selection
    • 4 = Create PUBLIC _oHTML object and generate file
    • 5 = Create PUBLIC _oHTML object without generating file
  • vIELink: Specifies a link to Internet Explorer object or Web browser control:
    • F./Empty = No link is created
    • .T. = Automatically creates instance of Internet Explorer
  • cStyle: Specifies Style ID reference in GenHTML.dbf.
  • cScope: Specifies the scope of scan by setting .cScope.
  • cHTMLClass: Specifies the class and, optionally, the class library and module that is instantiated for HTML object.
So to send a report named MyReport.FRX to an .HTM file named MyHTML.HTM and show it in Internet Explorer, execute the following command:
DO (_GENHTML) WITH "MyHTML.HTM","MyReport.FRX",2
The cStyle parameter allows you to apply style sheets to the generated text.
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date