aferra Posted May 23, 2016 Report Share Posted May 23, 2016 Antes com DBF fazia assim oFrPrn:SetWorkArea( <alias>, Select( <alias> ) ) Alguém que usa sabe como fazer usando a TDolphin? Quote Link to comment Share on other sites More sharing options...
Luiz Fernando Posted May 23, 2016 Report Share Posted May 23, 2016 Alessandro vc vai ter que fazer com array existe duas formas de fazer aCab:={'data','hora','codigo','qtd','saldo','saldoant','tipo','debecre','terminal','usuario','descricao','usu'} mTitulo:="Controle de estoque alterado manualmente "+dProduto Spool(mTitulo,@wArq,@wGera,'1',"kardex2.fr3",nNivel) tipoo:=1 if cInterno if !MSGNOYES("voce deseja imprimir <Sim> ou alterar <Nao>...") tipoo:=2 endif endif ccabec:='' ciff:='' NOMEMP:= nomfil oFrPrn := frReportManager():new() oFrPrn:SetIcon(1) oFrPrn:SetTitle( 'Relatorio' ) oFrPrn:LoadLangRes( 'brazil.xml') for nI:=1 To Len(aCab) cCabec+=aCab[nI]+IF(nI==Len(aCab),'',';') cIFF +="IIF( aField == '"+aCab[nI]+"',"+str(nI)+","+IF(nI<>Len(aCab),"",REPLICATE(')', Len(aCab) ) ) next oFrPrn:SetUserDataSet( "kardex2",cCabec,; {||nI := 1}, ; //--> bGoTop {||nI := nI + 1}, ; //--> bSkipPlus {||nI := nI - 1}, ; //--> bSkipMinus {||nI > Len(aSql)}, ; //--> bCheckEOF {|aField|nCol := &cIFF,; aSql[nI, nCol] } ) oFrPrn:LoadFromFile(cRela1) if mZoom='2' oFrPrn:PreviewOptions:SetZoomMode(2) endif oFrPrn:PreviewOptions:SetAllowEdit( .f. ) if tipoo= 2 oFrPrn:DesignReport() else if !wGera oFrPrn:ShowReport() else Aguarde1("Aguarde..."+CRLF+"Gerando Relatorio...") oFrPrn:PrepareReport() oDlgg:End() endif endif oFrPrn:SaveToFPFile("&wArq") oFrPrn:ClearDataSets() oFrPrn:DestroyFR() a outra seria assim oFrPrn := frReportManager():new() oFrPrn:SetIcon(1) oFrPrn:SetTitle( 'Relatorio' ) oFrPrn:LoadLangRes( 'brazil.xml') oFrPrn:SetUserDataSet("bFluxo", "codigo;descricao;saida;entrada", ; {||x := 1}, ; {||x := x + 1}, ; {||x := x - 1}, ; {||x > Len(aFluxo)}, ; {|aField| nCol := IIF( aField == "codigo", ; 1, ; IIF( aField == "descricao", ; 2, ; IIF( aField == "saida", ; 3, ; IIF( aField == "entrada", ; 4, 5 )))), aFluxo[x, nCol] } ) oFrPrn:LoadFromFile(cRela1) if mZoom='2' oFrPrn:PreviewOptions:SetZoomMode(2) endif oFrPrn:PreviewOptions:SetAllowEdit( .f. ) if tipoo= 2 oFrPrn:DesignReport() else if !wGera oFrPrn:ShowReport() else Aguarde1("Aguarde..."+CRLF+"Gerando Relatorio...") oFrPrn:PrepareReport() oDlgg:End() endif endif oFrPrn:SaveToFPFile("&wArq") oFrPrn:ClearDataSets() oFrPrn:DestroyFR() Quote Link to comment Share on other sites More sharing options...
aferra Posted May 23, 2016 Author Report Share Posted May 23, 2016 estava com medo disso, terei que trocar todos os relatórios, isso vai demandar um tempo, terei que pensar melhor. obrigado Luiz uma pergunta:, isso seria com qualquer SQL ( sqllib, sqlrdd, TMySql, etc ... ) Quote Link to comment Share on other sites More sharing options...
joaosolution Posted May 23, 2016 Report Share Posted May 23, 2016 Alessandro Com SQlLIB ou SQLRDD você consegue manter os mesmos selects do dbase, então não teria alterações drásticas inciais, poderia aproveitar muito código já pronto. E gradativamente você vai alterando para comandos SQL. Att João Bosco Quote Link to comment Share on other sites More sharing options...
aferra Posted May 23, 2016 Author Report Share Posted May 23, 2016 Ola João, obrigado pela resposta, blz...mas minha dúvida é passando para SQL necessariamente terei que usar da forma que o Luiz indicou? Quote Link to comment Share on other sites More sharing options...
aferra Posted May 25, 2016 Author Report Share Posted May 25, 2016 Resolvido da seguinte maneira. Já tenho criado o SELECT // os campos que quero para o relatório cCampos := "COD;NOM;APE;FON;CGC;INS;MUN;VEN;END;NUM;COM;CEP;BAI;EST;CON;EMA;ETQ" oFrPrn:SetUserDataSet( "oTmpImp", cCampos,; {|| oTmpImp:GoTop() },; {|| oTmpImp:Skip(1) },; {|| oTmpImp:Skip(-1) },; {|| oTmpImp:EoF() },; {|nField| oTmpImp:FieldGet( nField ) }) desta maneira mudo somente essas duas linhas e mais nada. Agradecimentos a Carles do forum Inter. o conceito é o mesmo do array, mas ai teria que mudar os browses, consultas, indices enfim muita mudança, desta maneira mudei somente trez itens do relatório e estou com o SQL. Obrigado Luiz, João e Marcelo(via skype) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.