Help about activex

Help about activex

Postby Wanderson » Wed Dec 18, 2013 2: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.
Wanderson
 
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm

Re: Help about activex

Postby Daniel Garcia-Gil » Wed Dec 18, 2013 3: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: Select all  Expand view
oActive:All:Item("Mes",0):Value := "12"


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


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


the format date is yyyy-mm-dd
Code: Select all  Expand view
SET DATE FORMAT "yyyy-mm-dd"

after finish the fill field
Code: Select all  Expand view
Set Date To British
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Help about activex

Postby Wanderson » Wed Dec 18, 2013 4: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: Select all  Expand view
oActive:All:Item("Mes",0):Value := "12"


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


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


the format date is yyyy-mm-dd
Code: Select all  Expand view
SET DATE FORMAT "yyyy-mm-dd"

after finish the fill field
Code: Select all  Expand view
Set Date To British
Wanderson
 
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm

Re: Help about activex

Postby Wanderson » Thu Dec 19, 2013 4: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.
Wanderson
 
Posts: 332
Joined: Thu Nov 17, 2005 9:11 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 78 guests