FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Help about activex
Posts: 332
Joined: Thu Nov 17, 2005 09:11 PM
Help about activex
Posted: Wed Dec 18, 2013 02:14 PM

Anyone can test this code please?

I try to put values in html fields but I have some insues, combobox fields don't work, I miss something?

Thanks in advance.

Include "FiveWin.Ch"

Function Main()

Local hWnd, oWndWeb, oActiveX, cUrl

Set Century on
Set Date To British
Set Epoch to 1960

DEFINE WINDOW oWndWeb From 10,10 To 51,115 TITLE "DARE"

oActiveX = TActiveX():New( oWndWeb, "Shell.Explorer" )

oWndWeb:oClient = oActiveX

cUrl:="http://www.sefaz.go.gov.br/dare/espontaneo/default.asp?cadastrado=true"

oActiveX:Do( "Navigate2", cUrl)

oWndWeb:center()

While oActiveX:Busy
syswait(.2)
End

oActiveX := oActiveX:Document()
oActiveX:All:Item("CCE",0):Value := "104110643"

oActiveX:All:Item("TipoTributo",0):Focus()
oActiveX:All:Item("TipoTributo",0):Value := "01"

oActiveX:All:Item("Receita",0):Focus()
oActiveX:All:Item("Receita",0):Value := "108 - ICMS Normal"
oActiveX:All:Item("CondicaoPagamento",0):Value := "4111 - Espontâneo"
oActiveX:All:Item("Referencia",0):Value := "001 - Dia 1"
oActiveX:All:Item("Mes",0):Value := "Dezembro"

oActiveX:All:Item("DataVencimento",0):Value := Dtoc(Date())
oActiveX:All:Item("DataPagamento",0):Value := Dtoc(Date())

oActiveX:All:Item("Ano",0):Value := "2013"
oActiveX:All:Item("Parcela",0):Value := "1"

oActiveX:All:Item("Valor",0):Value := "93,00"

oActiveX:All:Item("Info",0):Value := "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

ShowWindow(hWnd, 1 ) //SW_MAXIMIZE=3 SW_NORMAL=1 SW_MINIMIZE=6

ACTIVATE WINDOW oWndWeb

Return .t.

Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: Help about activex
Posted: Wed Dec 18, 2013 03:55 PM
Hello

you should use the option value in html select, not use the "description" or text

example the select "mes" the option dezembro the value is "12"

Code (fw): Select all Collapse
oActive:All:Item("Mes",0):Value := "12"


it's wrong too
Code (fw): Select all Collapse
oActive:All:Item("CondicaoPagamento",0):Value := "4111 - Espontâneo"


should use the option value... is "4111"
Code (fw): Select all Collapse
oActive:All:Item("CondicaoPagamento",0):Value := "4111"


the format date is yyyy-mm-dd
Code (fw): Select all Collapse
SET DATE FORMAT "yyyy-mm-dd"

after finish the fill field
Code (fw): Select all Collapse
Set Date To British
Posts: 332
Joined: Thu Nov 17, 2005 09:11 PM
Re: Help about activex
Posted: Wed Dec 18, 2013 04:35 PM
Daniel thanks for your answer but some fields called TipoTributo I put the correct value but don't show the options on next combobox field, the field Receita depends what I choose in TipoTributo. Can you test the code? Look field Tipo Tributo i put the value "ICMS" but next field called Código da Receita / Especificação don't show the options, try to change manually value (with mouse) of field Tipo Tributo to "Taxa" and see the next field works normally.
Any sugestion?

Thanks again.



Daniel Garcia-Gil wrote:Hello

you should use the option value in html select, not use the "description" or text

example the select "mes" the option dezembro the value is "12"

Code (fw): Select all Collapse
oActive:All:Item("Mes",0):Value := "12"


it's wrong too
Code (fw): Select all Collapse
oActive:All:Item("CondicaoPagamento",0):Value := "4111 - Espontâneo"


should use the option value... is "4111"
Code (fw): Select all Collapse
oActive:All:Item("CondicaoPagamento",0):Value := "4111"


the format date is yyyy-mm-dd
Code (fw): Select all Collapse
SET DATE FORMAT "yyyy-mm-dd"

after finish the fill field
Code (fw): Select all Collapse
Set Date To British
Posts: 332
Joined: Thu Nov 17, 2005 09:11 PM
Re: Help about activex
Posted: Thu Dec 19, 2013 04:14 PM

The combo dont work cause invoque onchange and loads data from database. How I can simulate combobox on change method in activex. I think this is a solution. Thanks.

Continue the discussion