nTopTop coordinate of the browse inside the container.
AdvPL GuideBrGetDDB():New( <nTop>, <nLeft>, <nBottom>, <nRight>, ... ) --> oBrowseCreates a data grid/browse with records in rows and information in columns.
BrGetDDB creates a visual grid object to display records from a data area in rows and columns. In the official example, the routine opens SA1, creates the browse inside a dialog, adds columns with TCColumn and uses code blocks to customize actions such as editing and deletion.
BrGetDDB():New( <nTop>, <nLeft>, <nBottom>, <nRight>, ... ) --> oBrowsenTopTop coordinate of the browse inside the container.
nLeftLeft coordinate of the browse inside the container.
nBottomBottom coordinate of the browse.
nRightRight coordinate of the browse.
oWndWindow or dialog where the component is created.
cAliasAlias used by the browse, such as SA1 in the example.
BrGetDDB():New( <nTop>, <nLeft>, <nBottom>, <nRight>, ... ) --> oBrowsenTopNuméricoRequiredPosição superior do componente.
nLeftNuméricoRequiredPosição esquerda do componente.
nBottomNuméricoRequiredPosição inferior do componente.
nRightNuméricoRequiredPosição direita do componente.
oWndObjetoOptionalContainer visual, normalmente um diálogo.
cAliasCaractereOptionalAlias da tabela/área de trabalho a exibir.
oBrowse: objeto browse criado.
oBrowse:AddColumn( TCColumn():New( <cTitle>, <bData>, ... ) ) -->cTitleCaractereRequiredTítulo exibido no cabeçalho da coluna.
bDataBloco de códigoRequiredBloco que retorna o valor da célula, como { || SA1->A1_COD }.
#Include "TOTVS.ch"
User Function BrGetDDB()
Local oDlg
Local oBrowse
DEFINE DIALOG oDlg TITLE "Exemplo BrGetDDB" ;
FROM 180, 180 TO 550, 700 PIXEL
DbSelectArea("SA1")
oBrowse := BrGetDDB():New( ;
1, 1, 260, 184, , , , oDlg, , , , , , , , , , , , ;
.F., "SA1", .T., , .F., , , )
oBrowse:bCustomEditCol := {|x, y, z| U_EditLine(x, y, z)}
oBrowse:bDelete := {|| ConOut("bDelete")}
oBrowse:AddColumn(TCColumn():New("Código", {|| SA1->A1_COD}, , , , "LEFT", , .F., .F., , , , .F.))
oBrowse:AddColumn(TCColumn():New("Loja", {|| SA1->A1_LOJA}, , , , "LEFT", , .F., .F., , , , .F.))
oBrowse:AddColumn(TCColumn():New("Nome", {|| SA1->A1_NOME}, , , , "LEFT", , .F., .F., , , , .F.))
ACTIVATE DIALOG oDlg CENTERED
Return
User Function EditLine(x, y, z)
ApMsgStop("editLine")
Return .T.Creates a dialog with a grid based on alias SA1 and three columns: Code, Store and Name.
© 2026 Usina.BR. All rights reserved. TOTVS, Protheus, Microsiga and their respective logos are trademarks of their owners. AdvPL Guide is independent and uses limited, attributed excerpts justified by educational purposes. See the Terms of Use. Terms of Use
Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.