× Linguagem de Programação ADVPL

Perguntas TReport Totalizar

Mais
10 anos 2 meses atrás #20992 por falecomsjunior
Boa Noite Pessoal, tudo bem?

estou com um problema ao criar um Relatório em TReport.

estou fazendo totalizar por fornecedor, porem eu preciso que no final seja totalizado tudo (Todos os fornecedores juntos e não consigo).

alguém poderia me ajudar?

segue a parte do fonte que totalizo por fornecedor.

//Primeira seção
oSection1 := TRSection():New(oReport,"Fornecedores",{"SA2"},aOrdem)

TRCell():New(oSection1,"A2_COD", "SA2", "Codigo")
TRCell():New(oSection1,"A2_NOME", "SA2", "Nome")

//Segunda seção
oSection2:= TRSection():New(oSection1,"Notas Parana",{"SD1","SF1","SE2"})

oSection2:SetLeftMargin(2)

TRCell():New(oSection2,"E2_FILIAL", "SD1", "Filial")
TRCell():New(oSection2,"E2_NUM", "SE2", "Titulo")
TRCell():New(oSection2,"E2_TIPO", "SE2", "Tipo")
TRCell():New(oSection2,"E2_EMISSAO", "SE2", "Emissão")
TRCell():New(oSection2,"E2_VENCTO", "SE2", "Vencimento")
TRCell():New(oSection2,"E2_BAIXA", "SE2", "Ult Pagto")
TRCell():New(oSection2,"E2_VALOR", "SE2", "Valor")
TRCell():New(oSection2,"E2_VALLIQ", "SE2", "Valor Pago")
TRCell():New(oSection2,"E2_ACRESC", "SE2", "Acrescimo")
TRCell():New(oSection2,"E2_DESCONT", "SE2", "Desconto")
TRCell():New(oSection2,"E2_SALDO", "SE2", "Saldo")
TRCell():New(oSection2,"E2_HIST", "SE2", "Historico")


//Totalizador por fornecedor
oBreak1 := TRBreak():New(oSection2,{|| (cAlias)->(A2_COD) },"Total:",.F.)
TRFunction():New(oSection2:Cell("E2_VALOR" ), "TOT1", "SUM", oBreak1,,,, .F., .F.)
TRFunction():New(oSection2:Cell("E2_VALLIQ" ), "TOT2", "SUM", oBreak1,,,, .F., .F.)
TRFunction():New(oSection2:Cell("E2_ACRESC" ), "TOT3", "SUM", oBreak1,,,, .F., .F.)
TRFunction():New(oSection2:Cell("E2_DESCONT" ), "TOT4", "SUM", oBreak1,,,, .F., .F.)
TRFunction():New(oSection2:Cell("E2_SALDO" ), "TOT5", "SUM", oBreak1,,,, .F., .F.)


Desde já agradeço.

Por favor Acessar ou Registrar para participar da conversa.

Tempo para a criação da página:0.075 segundos
Joomla templates by a4joomla