× Linguagem de Programação ADVPL

Perguntas Classe TReport

Mais
11 anos 8 meses atrás #16134 por gio100
Classe TReport foi criado por gio100
boa tarde pessoal,

estou usando a classe treport e me ocorreu uma situação que deve ser recorrente para algumas pessoas, ao exportar para excel o cabeçalho se repeti varias vezes dentro da planilha, isto deve ocorrer por ser quebra de pagina alguem ja deparou com esta situação se sim alguem conseguiu corrigir ?

Por favor Acessar ou Registrar para participar da conversa.

Mais
11 anos 8 meses atrás #16153 por henry.charriere
Respondido por henry.charriere no tópico Classe TReport
Gio, bom dia!

Não sei com vc está usando, mas vou postar um exemplo que tenho aqui, virá e meche uso ele.
Se não der certo com ele, post o seu código.

#include "protheus.ch"
#Include "TopConn.ch"
#Include "Colors.ch"

User Function MostraCF()

Local oReport

If TRepInUse()
dGet3 := FirstDay(dDatabase)
dGet4 := LastDay(dDatabase)

Pergunte("M000000006",.F.)

oReport := ReportDef()
oReport:PrintDialog()

EndIf

Return

Static Function ReportDef()

Local oReport
Local oSection
Local oBreak
Local sTitulo := "Carregamento de Pedidos CF - Data: " + dtoc(date())


oReport := TReport():New("MostraCF", sTitulo ,"M000000006",{|oReport| PrintReport(oReport)},"Carregamento de Pedidos CF")
oSection := TRSection():New(oReport,"Carregamento de Pedidos CF",{"SCJ"})

oReport:SetTotalInLine(.F.)
oSection:SetTotalInLine(.F.)

TRCell():New(oSection,"CJ_EMISSAO","SCJ")
TRCell():New(oSection,"CJ_NUM","SCJ")
TRCell():New(oSection,"CJ_CLIENT","SCJ")
TRCell():New(oSection,"A1_NOME","SCJ")
TRCell():New(oSection,"CK_ITEM","SCJ")
TRCell():New(oSection,"CK_PRODUTO","SCJ")
TRCell():New(oSection,"CK_DESCRI","SCJ")
TRCell():New(oSection,"CK_QTDVEN","SCJ")

TRFunction():New(oSection:Cell("CK_QTDVEN"),NIL,"SUM")


Return oReport

Static Function PrintReport(oReport)
Local oSection := oReport:Section(1)
Local cPart
Local cFiltro

#IFDEF TOP

MakeSqlExpr("M000000006")
oSection:BeginQuery()

BeginSql alias "QRYSD2"
SELECT * FROM PEDIDONAT
WHERE CJ_NUM BETWEEN %Exp:MV_PAR01% AND %Exp:MV_PAR02%
EndSql

oSection:EndQuery(mv_par05)

#ELSE

MakeAdvplExpr("M000000006")

#ENDIF

oSection:Print()

Return

Por favor Acessar ou Registrar para participar da conversa.

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