Ao carregar o grid na tela traz a primeira linha em branco, sempre.
Estou executando com uma query.
User Function OS_RESBB() Local oDlg As Object
Local aColumns As Array
Local cAlias := "RESUMO"
Local nContFlds As Numeric
Local nPrefixo as String
Local nNum as String
Local nParcela as String
Local nTipo as String
nPrefixo := (cAliasMrk)->E1_PREFIXO
nNum := (cAliasMrk)->E1_NUM
nParcela := (cAliasMrk)->E1_PARCELA
nTipo := (cAliasMrk)->E1_TIPO
cQry := "SELECT "
cQry += "E1CLIENTE,"
cQry += "E1_NOMCLI,"
cQry += "BM1_MATUSU,"
cQry += "BM1_NOMUSR, "
cQry += "E1_VENCTO, "
cQry += "BM1_VALOR, "
cQry += "BM1_TIPO, "
cQry += "BM1_CODTIP, "
cQry += "BM1_DESTIP, "
cQry += "BM1_CODEVE, "
cQry += "BM1_DESEVE "
cQry += "FROM SE1010 SE1 "
cQry += "INNER JOIN BM1010 BM1 "
cQry += "ON BM1.D_E_L_E_T = ' ' "
cQry += "AND BM1FILIAL = ' ' "
cQry += "AND BM1_CODINT = '0001' "
cQry += "AND BM1_CODEMP = E1_CODEMP "
cQry += "AND (BM1_PREFIX + BM1_NUMTIT + BM1_PARCEL + BM1_TIPTIT) "
cQry += "= (E1_PREFIXO + E1_NUM + E1_PARCELA + E1_TIPO) "
cQry += "WHERE SE1.D_E_L_E_T = ' ' "
cQry += "AND E1_FILIAL = '01' "
cQry += "AND (E1_PREFIXO + E1_NUM + E1_PARCELA + E1_TIPO) = '"+(nPrefixo + nNum + nParcela + nTipo)+"' "
cQry += "ORDER BY "
cQry += "BM1_MATUSU, "
cQry += "BM1_SEQ "
TCLINK()
//executa query
DBUseArea(.T., "TOPCONN", TCGenQry(NIL,NIL,cQry), (cAlias) , .F., .T. )
//Criando a janela
DEFINE MSDIALOG oDlg TITLE "Resumo da Cobrança" FROM 0,0 TO 500, 1500 PIXEL
//Criando Browse
oBrowse := FWBrowse():New()
oBrowse:SetDataTable( .T. )
oBrowse:SetAlias( cAlias )
oBrowse:SetOwner( oDlg )
oBrowse:SetDescription( "Resumo da Cobrança" )
//-------------------------------------------------------------------
// Adiciona as colunas do Browse
//-------------------------------------------------------------------
aColumns := {}
aFields := {}
aAdd( aFields,"E1_CLIENTE")
aAdd( aFields,"E1_NOMCLI")
aAdd( aFields,"BM1_MATUSU")
aAdd( aFields,"BM1_NOMUSR")
aAdd( aFields,"E1_VENCTO")
aAdd( aFields,"BM1_VALOR")
aAdd( aFields,"BM1_TIPO")
aAdd( aFields,"BM1_CODTIP")
aAdd( aFields,"BM1_DESTIP")
aAdd( aFields,"BM1_CODEVE")
aAdd( aFields,"BM1_DESEVE")
For nContFlds := 1 To Len( aFields )
AAdd( aColumns, FWBrwColumn():New() )
aColumns[Len(aColumns)]:SetData( &("{ || " + aFields[nContFlds] + " }") )
aColumns[Len(aColumns)]:SetTitle( aFields[nContFlds] )
aColumns[Len(aColumns)]:SetSize( 15 )
aColumns[Len(aColumns)]:SetID( aFields[nContFlds] )
Next nContFlds
oBrowse:SetColumns(aColumns)
oBrowse:Activate()
ACTIVATE MSDIALOG oDlg
(cAlias)->(DBCloseArea())
TCUnlink()
Return