PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 24 → WX - Exemplo de Relatorio CSV Lineprint totalizado com Surrond Break e Resumo Final abrindo o Excel no final.
WX - Exemplo de Relatorio CSV Lineprint totalizado com Surrond Break e Resumo Final abrindo o Excel no final.
Débuté par adrianoboller, 01 aoû. 2015 20:36 - 3 réponses
Membre enregistré
3 003 messages
Popularité : +89 (91 votes)
Posté le 01 août 2015 - 20:36
Procedure ExcelDetalhadoCsv()

//Relatorio Manual Excel
ok is boolean = False
CAB is int = 0
Lineprint, ResumoPrint is string = ""
sFileName is string = ""

ok = HExecuteQuery(QRY_Select_NG0009_RelatorioAuxiliar,hQueryDefault+hWithFilter,gnConvenioAdministrador +"_"+ gnSeqAutorzAdministrador)

IF ok = True THEN

FOR EACH QRY_Select_NG0009_RelatorioAuxiliar

IF CAB = 0 THEN
CAB = 1
Lineprint = "ccccc"+Charact(13)+Charact(10)
END

IF QRY_Select_NG0009_RelatorioAuxiliar.SubTotal01 <> 1
Lineprint += QRY_Select_NG0009_RelatorioAuxiliar.Coluna01 +";"
Lineprint += QRY_Select_NG0009_RelatorioAuxiliar.Coluna02 +";"
Lineprint += QRY_Select_NG0009_RelatorioAuxiliar.Coluna03 +";"
Lineprint += QRY_Select_NG0009_RelatorioAuxiliar.Coluna04 +";"
Lineprint += QRY_Select_NG0009_RelatorioAuxiliar.Coluna05 +";"
Lineprint += QRY_Select_NG0009_RelatorioAuxiliar.Coluna06 +";"
Lineprint += QRY_Select_NG0009_RelatorioAuxiliar.Coluna07 +";"
Lineprint += QRY_Select_NG0009_RelatorioAuxiliar.Coluna08 +";"
Lineprint += QRY_Select_NG0009_RelatorioAuxiliar.Coluna09 +";"
Lineprint += QRY_Select_NG0009_RelatorioAuxiliar.Coluna10 +";"
Lineprint += QRY_Select_NG0009_RelatorioAuxiliar.Coluna11 +";"
Lineprint += QRY_Select_NG0009_RelatorioAuxiliar.Coluna12 +";"
Lineprint += QRY_Select_NG0009_RelatorioAuxiliar.Coluna13 +";"
Lineprint += QRY_Select_NG0009_RelatorioAuxiliar.Coluna14 +";"
Lineprint += QRY_Select_NG0009_RelatorioAuxiliar.Coluna15 +";"
Lineprint += QRY_Select_NG0009_RelatorioAuxiliar.Coluna16 +";"
Lineprint += QRY_Select_NG0009_RelatorioAuxiliar.Coluna17 + Charact(13)+Charact(10)
ELSE

ResumoPrint += QRY_Select_NG0009_RelatorioAuxiliar.Coluna03 +";"+ QRY_Select_NG0009_RelatorioAuxiliar.Coluna15 +";"+ QRY_Select_NG0009_RelatorioAuxiliar.Coluna16 +";"+ QRY_Select_NG0009_RelatorioAuxiliar.Coluna17 +Charact(13)+Charact(10)

Lineprint += QRY_Select_NG0009_RelatorioAuxiliar.Coluna03 +";"
Lineprint += QRY_Select_NG0009_RelatorioAuxiliar.Coluna15 +";"
Lineprint += QRY_Select_NG0009_RelatorioAuxiliar.Coluna16 +";"
Lineprint += QRY_Select_NG0009_RelatorioAuxiliar.Coluna17 + Charact(13)+Charact(10)
Lineprint += Charact(13)+Charact(10)
Lineprint += Charact(13)+Charact(10)
END

END

END

Lineprint += Charact(13)+Charact(10)
Lineprint += "TOTAL GERAL Km: "+ gloQtdeKm + " - Valor Bruto R$: "+ gloValorGrandeTotal +" - % Desconto: "+ gloPorcGrandeDesconto +" - Valor Desconto: "+ gloValorGrandeDesconto +" - Valor Liquido R$: "+ gloValorGrandeTotalLiquido + Charact(13)+Charact(10)

Lineprint = Replace(Lineprint,".",",")

Lineprint += Charact(13)+Charact(10)
Lineprint += Charact(13)+Charact(10)
Lineprint += "Resumo: " + Charact(13)+Charact(10)
Lineprint += ResumoPrint + Charact(13)+Charact(10)

IF ok = True
sFileName = WS_ReturnGenerationDir() + "FechamentoVoucher"+ gnConvenioAdministrador +"_"+ gnSeqAutorzAdministrador +".csv"
fSaveBuffer(sFileName,Lineprint)
iDestination(iGenericXLS,sFileName)
FileDisplay(sFileName,"application/unknown","FechamentoVoucher"+ gnConvenioAdministrador +"_"+ gnSeqAutorzAdministrador +".csv")
fDelete(sFileName)
EN
Membre enregistré
3 003 messages
Popularité : +89 (91 votes)
Posté le 01 août 2015 - 20:36
:merci:
Membre enregistré
3 003 messages
Popularité : +89 (91 votes)
Posté le 13 août 2015 - 22:44
//Imprimindo o conteudo de um Buffer ou String concatenada
Lineprint is string = ""

Lineprint = "cabeça" + CRLF

LOOP (10)

Lineprint += "pescoço" + CRLF
Lineprint += "corpo" + CRLF
Lineprint += "quadril" + CRLF
Lineprint += "pernas" + CRLF

END

Lineprint += "pé"

//##############################################
//Botao Imprimir no Webdev + NewBorwser (_Blank)
//##############################################
//USUARIO X VOUCHER
sFileName is string
Lineprint = Replace(Lineprint,".",",")
sFileName = WS_ReturnGenerationDir() + "UsuarioCorridaVoucher"+ gnConvenioAdministrador +".xls"
fSaveText(sFileName,LINEPRINT)
iDestination(iGenericXLS,sFileName)
FileDisplay(sFileName,"application/unknown","CentroCustoFichas"+ gnConvenioAdministrador +".csv")
fDelete(sFileName)
//##############################################


OU


//Imprime o que tiver na query do reporter

//##############################################
//Botao Imprimir no Webdev + NewBorwser (_Blank)
//##############################################
//USUARIO X VOUCHER
sFileName is string
sFileName = WS_ReturnGenerationDir() + "UsuarioCorridaVoucher"+ gnConvenioAdministrador +".xls"
iDestination(iGenericXLS,sFileName)
iInitReportQuery(RPT_UsuarioCorridasVouchers,gnConvenioAdministrador,Edt_CentroCusto,EDT_DataInicial,EDT_DataFinal)
iPrintReport(RPT_UsuarioCorridasVouchers,gnConvenioAdministrador,Edt_CentroCusto,EDT_DataInicial,EDT_DataFinal)
FileDisplay(sFileName,"application/unknown", "UsuarioCorridaVoucher"+ gnConvenioAdministrador +".xls")
fDelete(sFileName)
//##############################################
Membre enregistré
3 003 messages
Popularité : +89 (91 votes)
Posté le 13 août 2015 - 22:44
:merci: