Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Html
Message
 
 
To
20/09/2002 21:15:14
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Title:
Re: Html
Miscellaneous
Thread ID:
00702988
Message ID:
00702992
Views:
11
>how do i convert my tabel (.dbf) into html style

Here are few ways:
1) In the IDE, browse the table, then click FILE, then SAVE AS HTML
2) Programatically with genhtml (see 'Genhtml.prg' in the VFP help) Example:
DO (_GENHTML) WITH "test.html", "test.dbf", 2
3) Create your own routine
LOCAL lnFieldNum as Integer
LOCAL lnFieldTotal as Integer
LOCAL lcHTML as String

CLOSE ALL
USE HOME()+"samples\data\customer.dbf"
lnFieldTotal = FCOUNT() 
lcHTML = "<HTML><BODY><TABLE BORDER = '1'>"
SCAN
	lcHTML = lcHTML + "<TR>"
	FOR lnFieldNum = 1 TO lnFieldTotal
		lcHTML = lcHTML + "<TD>" + TRANSFORM(EVALUATE("customer." + FIELD(lnFieldNum))) + "</TD>"
	ENDFOR
	lcHTML = lcHTML + "</TR>"	
ENDSCAN
lcHTML = lcHTML + "</TABLE></BODY></HTML>"
STRTOFILE(lcHTML,"test.html")
Previous
Reply
Map
View

Click here to load this message in the networking platform