- Fórum
- Protheus/Microsiga/Totvs
- AdvPL (Advanced Protheus Language)
- Relatórios
- Relatorio imprime mas não sai nenhuma informação
Perguntas Relatorio imprime mas não sai nenhuma informação
- jmfrolim
- Autor do Tópico
- Desconectado
- Membro Sénior
Menos
Mais
- Postagens: 52
- Obrigados Recebidos: 1
8 anos 9 meses atrás #30140
por jmfrolim
Relatorio imprime mas não sai nenhuma informação foi criado por jmfrolim
Pessoal criei um relatorio simples com ele imprime tudo certo, mas ao olhar no excel ele não traz nenhuma informação segue abaixo o código do relatorio
#Include 'Protheus.ch'
User Function RELNFCAN001()
local oReport
if TRepInuse()
Pergunte("NFSF3CANC",.F.)
oReport := ReportDef()
oReport:PrintDialog()
endIf
Return
Static Function ReportDef()
local oReport
local oSection
//local oBreak
//NFSF3CANC
oReport := TReport():New("RELNFCAN001","Relatorio de Notas ","NFSF3CANC",{|oReport| PrintReport(oReport)},"Relatorio de Notas")
oSection := TRSection():New(oReport,"Notas Fiscais",{"SF3","SA1"})
TRCell():New(oSection,"F3_ENTRADA" , "SF3")
TRCell():New(oSection,"F3_NFISCAL" , "SF3")
TRCell():New(oSection,"F3_SERIE" ,"SF3")
TRCell():New(oSection,"F3_ESTADO" , "SF3")
TRCell():New(oSection,"F3_CLIEFOR" , "SF3")
TRCell():New(oSection,"F3_LOJA" ,"SF3")
//TRCell():New(oSection,"A1_NOME" ,"SA1")
TRCell():New(oSection,"F3_CFO" ,"SF3")
TRCell():New(oSection,"F3_EMISSAO" ,"SF3")
TRCell():New(oSection,"F3_DTCANC" , "SF3")
TRCell():New(oSection,"F3_OBSERV" , "SF3")
TRCell():New(oSection,"F3_CHVNFE" , "SF3")
/* oBreak := TRBreak():New(oSection,oSection:Cell("A1_VEND"),"Sub Total Vendedores") // Quebra por Vendedor
TRFunction():New(oSection:Cell("A1_COD" ), NIL, "COUNT", oBreak)
TRFunction():New(oSection:Cell("A1_TEMVIS"), NIL, "SUM" , oBreak)*/
Return (oReport)
Static Function PrintReport(oReport)
local oSection := oReport:Section(1)
local cSerie:= "1"
local cFiltro := ""
MakeSqlExpr("NFSF3CANC")
oSection:BeginQuery()
BeginSql Alias "QRYSF3"
SELECT F3_FILIAL F3_EMISSAO,F3_NFISCAL,F3_SERIE,F3_ESTADO,F3_CLIEFOR,F3_LOJA,A1_NOME,F3_CFO,F3_ENTRADA,F3_DTCANC,F3_OBSERV,F3_CHVNFE
FROM %table:SF3% SF3 //INNER JOIN %table:SA1% SA1 ON F3_CLIEFOR = A1_COD AND F3_LOJA = A1_LOJA
WHERE F3_FILIAL = %xFilial:SF3% AND
F3_EMISSAO >= %Exp: Dtos(mv_par01)% AND
F3_EMISSAO <= %Exp: Dtos(mv_par02)% AND
F3_SERIE = %Exp:cSerie% AND
SF3.%NotDel%
ORDER BY F3_EMISSAO
EndSql
oSection:EndQuery()
oSection:Print()
Return (NIL)
#Include 'Protheus.ch'
User Function RELNFCAN001()
local oReport
if TRepInuse()
Pergunte("NFSF3CANC",.F.)
oReport := ReportDef()
oReport:PrintDialog()
endIf
Return
Static Function ReportDef()
local oReport
local oSection
//local oBreak
//NFSF3CANC
oReport := TReport():New("RELNFCAN001","Relatorio de Notas ","NFSF3CANC",{|oReport| PrintReport(oReport)},"Relatorio de Notas")
oSection := TRSection():New(oReport,"Notas Fiscais",{"SF3","SA1"})
TRCell():New(oSection,"F3_ENTRADA" , "SF3")
TRCell():New(oSection,"F3_NFISCAL" , "SF3")
TRCell():New(oSection,"F3_SERIE" ,"SF3")
TRCell():New(oSection,"F3_ESTADO" , "SF3")
TRCell():New(oSection,"F3_CLIEFOR" , "SF3")
TRCell():New(oSection,"F3_LOJA" ,"SF3")
//TRCell():New(oSection,"A1_NOME" ,"SA1")
TRCell():New(oSection,"F3_CFO" ,"SF3")
TRCell():New(oSection,"F3_EMISSAO" ,"SF3")
TRCell():New(oSection,"F3_DTCANC" , "SF3")
TRCell():New(oSection,"F3_OBSERV" , "SF3")
TRCell():New(oSection,"F3_CHVNFE" , "SF3")
/* oBreak := TRBreak():New(oSection,oSection:Cell("A1_VEND"),"Sub Total Vendedores") // Quebra por Vendedor
TRFunction():New(oSection:Cell("A1_COD" ), NIL, "COUNT", oBreak)
TRFunction():New(oSection:Cell("A1_TEMVIS"), NIL, "SUM" , oBreak)*/
Return (oReport)
Static Function PrintReport(oReport)
local oSection := oReport:Section(1)
local cSerie:= "1"
local cFiltro := ""
MakeSqlExpr("NFSF3CANC")
oSection:BeginQuery()
BeginSql Alias "QRYSF3"
SELECT F3_FILIAL F3_EMISSAO,F3_NFISCAL,F3_SERIE,F3_ESTADO,F3_CLIEFOR,F3_LOJA,A1_NOME,F3_CFO,F3_ENTRADA,F3_DTCANC,F3_OBSERV,F3_CHVNFE
FROM %table:SF3% SF3 //INNER JOIN %table:SA1% SA1 ON F3_CLIEFOR = A1_COD AND F3_LOJA = A1_LOJA
WHERE F3_FILIAL = %xFilial:SF3% AND
F3_EMISSAO >= %Exp: Dtos(mv_par01)% AND
F3_EMISSAO <= %Exp: Dtos(mv_par02)% AND
F3_SERIE = %Exp:cSerie% AND
SF3.%NotDel%
ORDER BY F3_EMISSAO
EndSql
oSection:EndQuery()
oSection:Print()
Return (NIL)
Por favor Acessar ou Registrar para participar da conversa.
- jmfrolim
- Autor do Tópico
- Desconectado
- Membro Sénior
Menos
Mais
- Postagens: 52
- Obrigados Recebidos: 1
8 anos 9 meses atrás #30152
por jmfrolim
Respondido por jmfrolim no tópico Relatorio imprime mas não sai nenhuma informação
Bom pessoal descobri qual era o erro aparentemente estava tudo certo, mas eu estava testando o relatório apenas no ambiente teste e nele não havia dados com de 2016, os mesmos que eu estava colocando nos parâmetros. segue os codigo fonte mais organizado caso alguém queira.
#include 'Protheus.ch'
#include "RWMAKE.CH"
#include "TOPCONN.CH"
User Function RLNFCN001()
local oReport
if TRepInuse()
Pergunte("NFSF3CANC",.F.)
oReport := ReportDef()
oReport:PrintDialog()
endIf
Return
Static Function ReportDef()
local oReport
local oSection
oReport := TReport():New("RELNFCAN001","Relatorio de Notas ","NFSF3CANC",{|oReport| PrintReport(oReport)},"Relatorio de Notas")
oSection := TRSection():New(oReport,"Notas Fiscais",{"SF3","SA1"})
TRCell():New(oSection,"F3_ENTRADA" , "SF3")
TRCell():New(oSection,"F3_NFISCAL" , "SF3")
TRCell():New(oSection,"F3_SERIE" ,"SF3")
TRCell():New(oSection,"F3_ESTADO" , "SF3")
TRCell():New(oSection,"F3_CLIEFOR" , "SF3")
TRCell():New(oSection,"F3_LOJA" ,"SF3")
TRCell():New(oSection,"A1_NOME" ,"SA1")
TRCell():New(oSection,"F3_CFO" ,"SF3")
TRCell():New(oSection,"F3_EMISSAO" ,"SF3")
TRCell():New(oSection,"F3_DTCANC" , "SF3")
TRCell():New(oSection,"F3_OBSERV" , "SF3")
TRCell():New(oSection,"F3_CHVNFE" , "SF3")
Return (oReport)
Static Function PrintReport(oReport)
local oSection := oReport:Section(1)
MakeSqlExpr("NFSF3CANC")
oSection:BeginQuery()
BeginSql Alias "QRYSF3"
SELECT F3_FILIAL,F3_EMISSAO,F3_NFISCAL,F3_SERIE,F3_ESTADO,F3_CLIEFOR,F3_LOJA,A1_NOME,F3_CFO,F3_ENTRADA,F3_DTCANC,F3_OBSERV,F3_CHVNFE
FROM %table:SF3% SF3 INNER JOIN %table:SA1% SA1 ON F3_CLIEFOR = A1_COD AND F3_LOJA = A1_LOJA AND SA1.%NotDel%
WHERE F3_FILIAL = %xFilial:SF3% AND
F3_EMISSAO >= %Exp:Dtos(mv_par01)% AND F3_EMISSAO <= %Exp:Dtos(mv_par02)% AND
SF3.%NotDel%
ORDER BY F3_EMISSAO
EndSql
oSection:EndQuery()
oSection:Print()
Return (NIL)
#include 'Protheus.ch'
#include "RWMAKE.CH"
#include "TOPCONN.CH"
User Function RLNFCN001()
local oReport
if TRepInuse()
Pergunte("NFSF3CANC",.F.)
oReport := ReportDef()
oReport:PrintDialog()
endIf
Return
Static Function ReportDef()
local oReport
local oSection
oReport := TReport():New("RELNFCAN001","Relatorio de Notas ","NFSF3CANC",{|oReport| PrintReport(oReport)},"Relatorio de Notas")
oSection := TRSection():New(oReport,"Notas Fiscais",{"SF3","SA1"})
TRCell():New(oSection,"F3_ENTRADA" , "SF3")
TRCell():New(oSection,"F3_NFISCAL" , "SF3")
TRCell():New(oSection,"F3_SERIE" ,"SF3")
TRCell():New(oSection,"F3_ESTADO" , "SF3")
TRCell():New(oSection,"F3_CLIEFOR" , "SF3")
TRCell():New(oSection,"F3_LOJA" ,"SF3")
TRCell():New(oSection,"A1_NOME" ,"SA1")
TRCell():New(oSection,"F3_CFO" ,"SF3")
TRCell():New(oSection,"F3_EMISSAO" ,"SF3")
TRCell():New(oSection,"F3_DTCANC" , "SF3")
TRCell():New(oSection,"F3_OBSERV" , "SF3")
TRCell():New(oSection,"F3_CHVNFE" , "SF3")
Return (oReport)
Static Function PrintReport(oReport)
local oSection := oReport:Section(1)
MakeSqlExpr("NFSF3CANC")
oSection:BeginQuery()
BeginSql Alias "QRYSF3"
SELECT F3_FILIAL,F3_EMISSAO,F3_NFISCAL,F3_SERIE,F3_ESTADO,F3_CLIEFOR,F3_LOJA,A1_NOME,F3_CFO,F3_ENTRADA,F3_DTCANC,F3_OBSERV,F3_CHVNFE
FROM %table:SF3% SF3 INNER JOIN %table:SA1% SA1 ON F3_CLIEFOR = A1_COD AND F3_LOJA = A1_LOJA AND SA1.%NotDel%
WHERE F3_FILIAL = %xFilial:SF3% AND
F3_EMISSAO >= %Exp:Dtos(mv_par01)% AND F3_EMISSAO <= %Exp:Dtos(mv_par02)% AND
SF3.%NotDel%
ORDER BY F3_EMISSAO
EndSql
oSection:EndQuery()
oSection:Print()
Return (NIL)
Por favor Acessar ou Registrar para participar da conversa.
- Fórum
- Protheus/Microsiga/Totvs
- AdvPL (Advanced Protheus Language)
- Relatórios
- Relatorio imprime mas não sai nenhuma informação
Tempo para a criação da página:0.090 segundos