SISCO Posted June 28, 2021 Report Share Posted June 28, 2021 Bom dia a todos Estou convertendo o meu sistema para Banco de Dados MySQL, já consegui fazer a conexão via ADO, mas estou tendo alguns problemas com xBrowse. 1) Campo tipo Date na coluna 2) Somatória na Coluna DEFINE DIALOG oDlg RESOURCE "BROWSER_PRO" TITLE cSt_MODULO FONT oFont REDEFINE BITMAP ID 5000 RESOURCE "BANNER" OF oDlg ADJUST REDEFINE SAY OSt_MODULO VAR cSt_MODULO ID 5001 OF oDlg FONT oFont_Banner01 PICTURE "@X" COLORS CLR_BLACK, RGB(198, 255, 198) UPDATE REDEFINE XBROWSE oBrw ID 100 OF oDlg DATASOURCE o_produto ; COLUMNS "id","descricao","qtdest","unidade","vlunidade","vlmaster", "vlundmast", "vlcusto", "(((vlmmaster/vlCusto)-1)*100)", "qtdmin" ; COLSIZES 40, 280, 70, 30, 70, 70, 70, 70, 70, 70, 70 ; HEADERS "id", "Descrição", "Estoque", "Und", "Vl.Unit.", "Vl.Master", "Vl.Und.Mast", "Vl.Custo", "Margem", "Est.Minimo" ; PICTURES '99999', nil, '@E 999,999.999', nil, '@E 999,999.99', '@E 999,999.99', '@E 999,999.99', '@E 999,999.99', '@E 999.999', '@E 99,999.99' ; CELL LINES NOBORDER oBrw:nMarqueeStyle := MARQSTYLE_HIGHLCELL // Estilo da linha selecionada MARQSTYLE_HIGHLROW - Linha Azul // MARQSTYLE_HIGHLCELL - grade azul oBrw:lVScroll := .T. // Barra rolagem vertical oBrw:lColDividerComplete := .f. // Sem grade no browse oBrw:nHeaderLines := 1 // Altura encabezamiento oBrw:nDataLines := 1 // Altura líneas oBrw:lRecordSelector := .t. // poner o no, COL de la flechita de la izq oBrw:bClrStd := { || { CLR_BLACK, ColorFundo(oBrw:aCols[3],oBrw:aCols[10]) } } // Efecto pijama oBrw:bKeyDown:={|nKey| ProcKeyProduto(nKey,oBrw,oDlg)} oBrw:SetFocus() Quote Link to comment Share on other sites More sharing options...
sfwinfo Posted June 28, 2021 Report Share Posted June 28, 2021 Aconselharia migra para sql nativo. Estou nesse processo e está fluindo muito bem. Abraco Quote Link to comment Share on other sites More sharing options...
aferra Posted June 28, 2021 Report Share Posted June 28, 2021 Acho que todas as colunas deveriam ser assim o_produto:<nome_campo> (((o_produto:vlmmaster/o_produto:vlCusto)-1)*100) Quote Link to comment Share on other sites More sharing options...
SISCO Posted June 29, 2021 Author Report Share Posted June 29, 2021 Bom dia Obrigado pelaS respostas, só consigo responder pela manhã. Não funcionou, vou dar mais uma estudada se conseguir resolver coloco no grupo Quanto ao banco de dados nativo não sei se tem muito material, e devido a isso acabei optando pelo ODBC Quote Link to comment Share on other sites More sharing options...
SISCO Posted June 30, 2021 Author Report Share Posted June 30, 2021 Bom dia Consegui resolver o problema Select ficou assim o_produto := oCon:Execute( "SELECT id, descricao, qtdest, unidade , vlunidade, vlmaster, vlundmast, vlcusto, (((vlmaster/vlCusto)-1)*100) AS 'margem', qtdmin FROM produto ORDER BY descricao" ) calculo direto no select e criado uma AS margem xBrowse exibo com nome criado COLUMNS 'id','descricao','qtdest','unidade','vlunidade','vlmaster', 'vlundmast', 'vlcusto', 'margem', 'qtdmin' Posso usar 'id' ou o_produto:Fields[ "id"]:Value() Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.