Tim,
I was also looking for showing html from FW and I found this function on the forum and was playing with it.
I put your form insite the html file you have to put in the samples dir of you choise (change the path in the prg)
It seem to put the data into the form, but dos not send. It can however be a starting point from where to look.
- Code: Select all Expand view
#include "FiveWin.ch"
#Define OLECMDID_PRINT 6
#Define OLECMDEXECOPT_PROMPTUSER 1
#Define OLECMDEXECOPT_DONTPROMPTUSER 2
Function Main()
local oWnd, oActiveX1, oActiveX2, cTemp
cTemp = '<head><link rel="stylesheet" href="temp.css"></head><table class="styled-table"><thead><tr><th>36</th><th>38</th>'
cTemp += '<th>40</th><th>42</th><th>44</th></tr></thead><tbody><tr><td></td><td>1</td><td>1</td><td>1</td><td>2</td></tr></tbody></table>'
DEFINE WINDOW oWnd TITLE "FiveWin multiple ActiveX support"
//@ 10, 10 ACTIVEX oActiveX1 PROGID "Shell.Explorer" OF oWnd SIZE 500, 150
@ 5, 5 BUTTON "&OK" OF oWnd SIZE 40, 12 ACTION drukhtml()
//oActiveX1:Do( "Navigate2", "c:\fwharb\samples\temp.html" )
ACTIVATE WINDOW oWnd
return nil
function drukhtml()
cHtml:= "c:\fwharb\samples\temp.html"
printhtml(cHtml,1,.t.)
return nil
FUNCTION PrintHtml(cHtmlOrUrl,nCopies,lShow)
static oWnd1:=nil, oBar, oIe
local i
default lShow:=.f.,nCopies:=1
if oWnd1=nil
DEFINE WINDOW oWnd1
DEFINE BUTTONBAR oBar OF oWnd1
DEFINE BUTTON OF oBar;
PROMPT 'Print'
endif
oIe = TActiveX():New( oWnd1, "Shell.Explorer" )
oIe:Do( "Navigate2", cHtmlOrUrl)
if lshow
oWnd1:oClient = oIe
ShowWindow(oWnd1, 1 ) && 1=Show,0=hide
ACTIVATE WINDOW oWnd1
oWnd1:Center()
endif
sysrefresh()
RETURN nil
FUNCTION PrintHtml2(cHtmlOrUrl,nCopies,lShow)
static oWnd:=nil, oBar, oIe
local i
default lShow:=.f.,nCopies:=1
if oWnd=nil
DEFINE WINDOW oWnd
DEFINE BUTTONBAR oBar OF oWnd
DEFINE BUTTON OF oBar;
PROMPT 'Print';
ACTION oIe:Do( "ExecWB", OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER )
oIe = TActiveX():New( oWnd, "Shell.Explorer" )
endif
oIe:Do( "Navigate2", cHtmlOrUrl)
do while alltrim(oIe:document:readyState) <> 'complete'
sysrefresh()
waitseconds(.5)
enddo
if lshow
oWnd:oClient = oIe
ShowWindow(oWnd, 1 ) && 1=Show,0=hide
ACTIVATE WINDOW oWnd
oWnd:Center()
else
for i=1 to nCopies
msgwait('Printing large receipt (' + alltrim(str(i)) + ' of '+alltrim(str(nCopies))+' copies).',,2)
oIe:Do( "ExecWB", OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER )
next i
endif
sysrefresh()
RETURN nil
temp.html has folowing code inside :
<form name=”PrePage” method = “post” action = “https://SourceServer.com/payment/Catalog.aspx”>
<input type = “hidden” name = “LinkId” value =”jiehiu378208kijfiiuie” />
<input type = “image” src =”//content.SourceServer.com/images/getit.gif” /></form>