Jump to content
Fivewin Brasil

xbrowse()


Vitor Reis

Recommended Posts

Algo assim?

 

	#include "fivewin.ch"
#include "xbrowse.ch"


function Main()

   local oWnd, oBrw, oDbf

   use customer
   database odbf

   define window ownd
   @ 0,0 xbrowse oBrw of oWnd ;
         object odbf  ;
         rows { 10, 5, 30, 50, 100 } // Array of record numbers
   
   oBrw:nRowHeight := 55

   oBrw:CreateFromCode()
   oWnd:oClient := oBrw

   activate window oWnd

return nil
	 
	ou,
	 
	FUNCTION utest()
 LOCAL  oWnd, oBrw
 LOCAL aArray := { {Space(200), Space(200)} }

 DEFINE window oWnd

   @ 0,0 xbrowse oBrw of oWnd ;
         headers '1', '2';
         columns 1,2;
         Array aArray

   WITH OBJECT oBrw

        :nDataLines := 4
        :nMarqueeStyle := MARQSTYLE_HIGHLROWRC

        :aCols[1]:nDataLines := 4
        :aCols[1]:nEditType  := EDIT_GET
        :aCols[1]:lAutoSave  := .T.
        :aCols[1]:nWidth     := 200
        :aCols[1]:lAllowSizing := .F.
        :aCols[1]:cEditPicture := '@!'       //COMMENT THIS AND YOU CAN CTRL+ENTER FOR ANOTHER LINE...



        :aCols[2]:nDataLines := 4
        :aCols[2]:nEditType  := EDIT_GET
        :aCols[2]:lAutoSave  := .T.
        :aCols[2]:nWidth     := 200
        :aCols[2]:lAllowSizing := .F.
        :aCols[2]:cEditPicture := '@!'     //is this odd because I need all text entered by end user all upper case

   END WITH

   oBrw:CreateFromCode()

   oWnd:oClient := oBrw

   activate window oWnd
RETURN
	

Link to comment
Share on other sites

Não sei como vc esta atrbuindo o valor no vetor, mas tente assim... (mantem sempre o valor numerico, e só transforma para exbir)

        oLbx:aCols[3]:bStrData := {|| Transform(aDados[oLbx:nArrayAt,7],"@E 9,999.99") }
        oLbx:aCols[3]:cHeader := "Total"         
        oLbx:aCols[3]:nWidth  := 80
        oLbx:aCols[3]:oDataFont := oFnt4
 

Link to comment
Share on other sites

preciso de alguem que saiba mexer no xbrowse.prg   eu nao estou usando nada do que vcs responderam acima.. 

MEU CODIGO:  (tenho uma tabela simples em DBF) 

use teste alias teste new shared
xbrNumFormat("A",.f.)
teste->(xbrowse())
 

veja a imagem abaixo o que ele traz errado para o excel 

VEJA3.JPG

 

eu anexei um arquivo jpg mas acho que ninguem vê neh..  nao sei como anexar arquivo aqui.. mas enfim..  

vou tentar explicar.. 

ele abre um browse correto.. valor certinho igual está no dbf,

exemplo:  1,5000  (valor correto igual dbf)

                 2,3010 (valor correto igual dbf)

                 

mas quando clico no botao excel. ele abre o excel assim

exemplo:  15000.00

                23010,00 

 

teria que mexer no xbrowse.prg  em algum lugar lá teria que dividir o valor por 10000 antes de jogar para o excel, pois está com a formatacao errada.. já tentei mexer no xbrowse.prg mas nao consegui

 

 

 

Link to comment
Share on other sites

 

Vitor, você precisa criar uma FUNCTION para controlar os dados que você precisa.

Escrever BROWSE() ou

XBROWSE(),

Somente edita o Banco de dados.

eu nao faço nada. apenas uso o que já existe..  xbrowse().. ele funciona muito bem.. o methodo que gera o excel é que tá errado a formatacao..  testa pra vc ver.. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...