Quantcast
Channel: Home of ActiveVFP - Foxpro on the World Wide Web
Viewing all 1109 articles
Browse latest View live

New Post: Problem with printing report

$
0
0
Forget about last comment. I can't be an access issue since the same user is creating the data file. What caught my eyes in the error text is that the data file has no extension. Could this be the problem? try:
oHelper.cDataSource = pathTab +  ".DBF"
Victor

New Post: Problem with printing report

$
0
0
I added the extension and now the error is this:
.... err#= 1426 line= 182 OLE error code 0x80020006: Nome sconosciuto...

New Post: Problem with printing report

$
0
0
Hum. I ran out of ideas here. :( Something is wrong but I can't say what could be.

Victor

New Post: Problem with printing report

$
0
0
If you want, i can post the full code of my print page. Maybe, i do a mistake...

New Post: Problem with printing report

$
0
0
That could help. Also add a printout of your window explorer listing your data file.

Victor

New Post: Problem with printing report

$
0
0
Ok, this is the code of my print page:
<%
    LOCAL tipo, numero, alfa, fcodcli, nTab, PathTab, PathDB
    STORE "" TO tipo, numero, alfa, fcodcli, nTab, PathTab, PathDB
    LOCAL totaledocumento, totalecolli, totalepeso
    STORE 0 TO totaledocumento, totalecolli, totalepeso
    LOCAL cimponi, cimposta, totdoc, sQta, totimponi, totimposta
    STORE 0 TO cimponi, cimposta, totdoc, sQta, totimponi, totimposta
                            
    tipo = oRequest.querystring("tipo")
    numero = oRequest.querystring("num")
    alfa = oRequest.querystring("alfa") 
    fdatdoc = oRequest.QueryString("datdoc")
    fcodcli = oRequest.QueryString("codcli")
    nTab = "cStampa" + SYS(3)
    PathTab = oProp.AppStartPath + "temp\" + nTab
    PathDB = GET_PATH_AZIENDA(ALLTRIM(oSession.value("_tipodoc")))
    saldoPrec = 0
    * CREAZIONE TABELLA TEMPORANEA
    CREATE TABLE (PathTab) FREE ( ;
        aragsoc c(45) NULL, ;
        aindiri c(35) NULL, ;
        acap c(5) NULL, ;
        alocali c(25) NULL, ;
        aprovin c(2) NULL, ;
        atelefo c(10) NULL, ;
        numdoc n(6) NULL, ;
        alfdoc c(2) NULL, ;
        datdoc d NULL, ;
        codcli c(7) NULL, ;
        descli c(50) NULL, ;
        indiri c(35) NULL, ;
        cap c(5) NULL, ;
        locali c(25) NULL, ;
        prov c(2) NULL, ;
        pivacli c(11) NULL, ;
        clicfs c(16) NULL, ;
        tipdoc c(3) NULL, ;
        destipdoc c(50) NULL, ;
        codcau n(3) NULL, ;
        descau c(50) NULL, ;
        codcon n(3) NULL, ;
        mezzo c(50) NULL, ;
        coddest c(3) NULL, ;
        desdest c(50) NULL, ;
        codart c(30) NULL, ;
        desart c(50) NULL, ;
        colli n(8) NULL, ;
        qta n(15,3) NULL, ;
        prezzo n(6,2) NULL,;
        acconto n(6,2) NULL, ;
        annota c(200) NULL, ;
        codiva n(3) NULL, ;
        periva n(5,2) NULL, ;
        totdoc n(6,2) NULL, ;
        saldop n(6,2) NULL, ;
        lotto c(20) NULL, ;
        imponi n(6,2) NULL, ;
        imposta n(6,2) NULL)
    USE
    && USE oProp.AppStartPath + "\temp\" + nTab IN 0 ALIAS cStampa
    
    *DATI AZIENDA
    SELECT * FROM PathDB + "k_aziend" ;
    WHERE k_aziend.anno = YEAR(CTOD(oSession.value("_datadocumento"))) ;
    INTO CURSOR cAzienda NOCONSOLE
    
    IF RECCOUNT("cAzienda") > 0
        aZragsoc = cAzienda.t_azraso
        aZindiri = cAzienda.t_azindi
        aZcap = cAzienda.t_az_cap
        aZlocali = cAzienda.t_azloca
        aZprovin = cAzienda.t_azprov
        aZtelefo = cAzienda.t_azdapt + cAzienda.t_azdatl
    ENDIF
    
    * SALDO PRECEDENTE
    SELECT * FROM PathDB + "k_salcfp" ;
    WHERE cftiprec+cfcodice+cf__anno == "C"+ALLTRIM(fcodcli)+STR(YEAR(CTOD(oSession.value("_datadocumento"))),4) ;
    INTO CURSOR cSaldi NOCONSOLE
    
    IF RECCOUNT("cSaldi") > 0
        saldoPrec = (cSaldi.cfsalini+cSaldi.cfdarper+cSaldi.cfdarpre-cSaldi.cfaveper-cSaldi.cfavepre)
    ENDIF
    
    * QUERY
    SET ENGINEBEHAVIOR 70
    SELECT k_docume.mvnumdoc AS numdoc, k_docume.mvalfdoc AS alfdoc, k_docume.mvdatdoc AS datdoc, ;
        k_pardoc.t_tdvdes AS destipdoc, k_caumag.t_macade AS descau, ;
        k_client.cfdescr1 AS descli, k_client.cfpariva AS pivacli, ;
        k_traspo.t_ms_des AS mezzo, k_docume.mvdesmer AS coddestin, k_destin.dsdescr1 AS destin, ;
        k_docume.mvcoddoc AS tipdoc, k_docume.mvdesart, k_docume.mvcolli, k_docume.mvqtamov, k_docume.mvvaluni, ;
        k_docume.mvtotdoc, k_docume.mvaccont, k_docume.mvannota, k_codiva.t_ivaper AS periva, k_artico.arcodiva AS codiva, ;
        k_docume.mvcodcau, k_docume.mvcaucon, k_docume.mvcodart, ;
        k_client.cfindiri, k_client.cf___cap, k_client.cflocali, k_client.cfprovin, k_client.cfcodfis, ;
        k_vettor.t_sp_des as tipvett ;
    FROM PathDB + "k_docume" ;
        LEFT JOIN PathDB + "k_client" ON k_docume.mvcodclf == k_client.cfcodice AND mvtiprec = "C" ;
        LEFT JOIN PathDB + "k_pardoc" ON k_docume.mvcoddoc == k_pardoc.t_codice ;
        LEFT JOIN PathDB + "k_caumag" ON k_docume.mvcodcau == k_caumag.t_codice ;
        LEFT JOIN PathDB + "k_destin" ON k_docume.mvdesmer == k_destin.dscoddes ;
        LEFT JOIN PathDB + "k_artico" ON k_docume.mvcodart == k_artico.arcodart ;
        LEFT JOIN PathDB + "k_codiva" ON k_artico.arcodiva == k_codiva.t_codice ;
        LEFT JOIN PathDB + "k_vettor" ON k_docume.mvcodvet == k_vettor.t_codice ;
        LEFT JOIN PathDB + "k_traspo" ON k_traspo.t_codice = k_docume.mvcodspe ;
    WHERE ALLTRIM(k_docume.mvcoddoc) == ALLTRIM(oSession.value("_tipodoc")) ;
        AND k_docume.mvnumdoc = INT(VAL(numero)) AND ALLTRIM(k_docume.mvalfdoc) == ALLTRIM(alfa) ;
        AND k_docume.mvdatdoc = CTOD(ALLTRIM(fdatdoc)) AND k_docume.mvcodclf == fcodcli AND k_docume.mvtiprec = "C" ;
    GROUP BY numdoc,alfdoc,datdoc,mvcodart,mvvaluni,mvqtamov ;
    INTO CURSOR cDocs NOCONSOLE
    
    IF RECCOUNT("cDocs") > 0
        DO WHILE NOT EOF("cDocs")
            totalecolli = totalecolli + cDocs.mvcolli
            totalepeso = totalepeso + cDocs.mvqtamov    
            PzNoIva = (cDocs.mvvaluni*cDocs.mvqtamov)/(1+(cDocs.periva/100)+.001)
            cimponi = (cDocs.mvvaluni*cDocs.mvqtamov)
            cimposta = ((cDocs.mvvaluni*cDocs.mvqtamov)*(1+(cDocs.periva/100))) - (cDocs.mvvaluni*cDocs.mvqtamov)
            totimponi = totimponi + cimponi
            totimposta = totimposta + cimposta
            totaledocumento = totaledocumento + cimponi + cimposta
            INSERT INTO (PathTab)(numdoc, alfdoc, datdoc, codcli, descli, pivacli, ;
                indiri, cap, locali, prov, clicfs, ;
                tipdoc, destipdoc, codcau, descau, codcon, ;
                mezzo, coddest, desdest, ;
                codart, desart, colli, qta, prezzo, acconto, ;
                annota, codiva, periva, saldop, lotto, imponi, imposta) ;
            VALUES(cDocs.numdoc, cDocs.alfdoc, cDocs.datdoc, fcodcli, cDocs.descli, cDocs.pivacli, ;
                cDocs.cfindiri, cDocs.cf___cap, cDocs.cflocali, cDocs.cfprovin, cDocs.cfcodfis, ;
                ALLTRIM(oSession.value("_tipodoc")), cDocs.destipdoc, cDocs.mvcodcau, cDocs.descau, cDocs.mvcaucon, ;
                cDocs.mezzo, cDocs.coddestin, cDocs.destin, ;
                cDocs.mvcodart, cDocs.mvdesart, cDocs.mvcolli, cDocs.mvqtamov, cDocs.mvvaluni, cDocs.mvaccont, ;
                cDocs.mvannota, cDocs.codiva, cDocs.periva, saldoPrec, "", cimponi, cimposta)
                
            UPDATE (PathTab) ;
                SET aragsoc = aZragsoc, ;
                    aindiri = aZindiri, ;
                    acap = aZcap, ;
                    alocali = aZlocali, ;
                    aprovin = aZprovin, ;
                    atelefo = aZtelefo
                    
            SKIP IN cDocs
        ENDDO
    ENDIF
    
    * STAMPA
    LOCAL tcReturn
    tcReturn = "NESSUN ERRORE"
    
    TRY
        LOCAL oHelper
        oHelper = CREATEOBJECT("avfpHelpers.avfpReportHelper")
        oHelper.cPrinterName = "35PPM PCL6"
        oHelper.cReportFile = oProp.AppStartPath + "reports\doc.frx"
        oHelper.cDataSource = PathTab + ".DBF"
        oHelper.lAutoDropDataSource = .T.
        oHelper.cReportOutput = oProp.AppStartPath + "ReportOutput.app"
        oResult = oHelper.Execute()

        IF NOT oResult.result
            tcReturn = oResult.data
        ENDIF   
    CATCH TO loError
        tcReturn = [Error: ] + STR(loError.ERRORNO) + CHR(13) + ;
        [LineNo: ] + STR(loError.LINENO) + CHR(13) + ;
        [Message: ] + loError.MESSAGE + CHR(13) + ;
        [Procedure: ] + loError.PROCEDURE + CHR(13) + ;
        [Details: ] + loError.DETAILS + CHR(13) + ;
        [StackLevel: ] + STR(loError.STACKLEVEL) + CHR(13) + ;
        [LineContents: ] + loError.LINECONTENTS
    ENDTRY

%>
<br/>last error<br />
<% IF NOT ISNULL(oHelper.oLastError) %>
    <%=oHelper.oLastError.Description%>
<% ENDIF %>
<br/>errore try<br />
<%=tcReturn%>
<br/>log<br />
<%=oResult.Log%>

New Post: Problem with printing report

$
0
0
And this is my data dir:
----------------------------------------------------------------------------------------------------
webdoc\                                                          
----------------------------------------------------------------------------------------------------
webdoc\maincode.app 
webdoc\ReportOutput.app 
webdoc\___auth.avfp 
webdoc\___clienti.avfp  
webdoc\articolicat.avfp 
webdoc\artprz.avfp  
webdoc\artqta.avfp  
webdoc\categorie.avfp   
webdoc\checkSessione.avfp     
webdoc\creacliente.avfp 
webdoc\creadoc.avfp 
webdoc\default.avfp 
webdoc\doc_inviato.avfp 
webdoc\documento.avfp   
webdoc\elenco_clienti.avfp    
webdoc\elenco_documenti.avfp  
webdoc\elenco_variabili_sessione.avfp   
webdoc\home.avfp    
webdoc\mod_footer.avfp  
webdoc\mod_libs.avfp
webdoc\mod_pulsanti.avfp
webdoc\operazione.avfp  
webdoc\riepdoc.avfp 
webdoc\stampa.avfp  
webdoc\stordoc.avfp 
webdoc\test.avfp    
webdoc\tipdoc.avfp  
webdoc\vedidoc.avfp 
webdoc\Web.Config   
webdoc\activevfp.dll
webdoc\msvcr71.dll  
webdoc\VFP9RENU.DLL 
webdoc\vfp9t.dll    
webdoc\vfp2c32.fll  
webdoc\index.html   
webdoc\config.ini   
webdoc\html5shiv.min.js 
webdoc\jquery.min.js
webdoc\respond.min.js   
webdoc\activevfp.dll.manifest 
webdoc\webapp.manifest  
----------------------------------------------------------------------------------------------------
webdoc\bin\                                                      
----------------------------------------------------------------------------------------------------
webdoc\bin\activevfp_dotnetproxy.dll    
webdoc\bin\App_Code.dll 
webdoc\bin\AspManifestHelpers.dll       
webdoc\bin\avfphelpers.DLL    
webdoc\bin\avfphelpers.tlb    
----------------------------------------------------------------------------------------------------
webdoc\css\                                                      
----------------------------------------------------------------------------------------------------
webdoc\css\Web.Config   
webdoc\css\bootstrap-theme.css
webdoc\css\bootstrap-theme.min.css      
webdoc\css\bootstrap.css
webdoc\css\bootstrap.min.css  
webdoc\css\jquery-ui.css
webdoc\css\jquery.mobile-1.4.5.css      
webdoc\css\jquery.mobile-1.4.5.min.css  
webdoc\css\rStile.css   
webdoc\css\bootstrap-theme.css.map      
webdoc\css\bootstrap.css.map  
----------------------------------------------------------------------------------------------------
webdoc\css\images\                                               
----------------------------------------------------------------------------------------------------
webdoc\css\images\add.png     
webdoc\css\images\edit.png    
webdoc\css\images\favorite.png
webdoc\css\images\remove.png  
webdoc\css\images\sub.png     
----------------------------------------------------------------------------------------------------
webdoc\data\                                                     
----------------------------------------------------------------------------------------------------
webdoc\data\docs.dbf
----------------------------------------------------------------------------------------------------
webdoc\fonts\                                                    
----------------------------------------------------------------------------------------------------
webdoc\fonts\Web.Config 
webdoc\fonts\glyphicons-halflings-regular.eot 
webdoc\fonts\glyphicons-halflings-regular.svg 
webdoc\fonts\glyphicons-halflings-regular.ttf 
webdoc\fonts\glyphicons-halflings-regular.woff
----------------------------------------------------------------------------------------------------
webdoc\images\                                                   
----------------------------------------------------------------------------------------------------
webdoc\images\Web.Config   
----------------------------------------------------------------------------------------------------
webdoc\images\imgcat\                                            
----------------------------------------------------------------------------------------------------
webdoc\images\imgcat\01.jpg   
webdoc\images\imgcat\02.jpg   
webdoc\images\imgcat\040000.jpg         
webdoc\images\imgcat\nofoto.png         
----------------------------------------------------------------------------------------------------
webdoc\javascript\                                               
----------------------------------------------------------------------------------------------------
webdoc\javascript\Web.Config  
webdoc\javascript\avfp.js     
webdoc\javascript\bootstrap.js
webdoc\javascript\bootstrap.min.js      
webdoc\javascript\ie10-viewport-bug-workaround.js
webdoc\javascript\jquery-1.10.2.js      
webdoc\javascript\jquery-ui.js
webdoc\javascript\jquery.js   
webdoc\javascript\jquery.min.js         
webdoc\javascript\jquery.mobile-1.4.5.js
webdoc\javascript\jquery.mobile-1.4.5.min.js  
webdoc\javascript\mvc.js
webdoc\javascript\jquery.mobile-1.4.5.min.map 
----------------------------------------------------------------------------------------------------
webdoc\mvc\                                                      
----------------------------------------------------------------------------------------------------
webdoc\mvc\spaAnotherView.avfp
webdoc\mvc\spaHomeView.avfp   
webdoc\mvc\spaAnotherView.js  
webdoc\mvc\spaHomeView.js     
----------------------------------------------------------------------------------------------------
webdoc\prg\                                                      
----------------------------------------------------------------------------------------------------
webdoc\prg\AVFPutilities.FXP  
webdoc\prg\compileifnew.FXP   
webdoc\prg\delegate.FXP 
webdoc\prg\docount.FXP  
webdoc\prg\main.FXP 
webdoc\prg\pages.FXP
webdoc\prg\utiltest.FXP 
webdoc\prg\utiltest2.FXP
webdoc\prg\avfputilities.prg  
webdoc\prg\CompileIfNew.prg   
webdoc\prg\delegate.PRG 
webdoc\prg\docount.prg  
webdoc\prg\main.prg 
webdoc\prg\pages.prg
webdoc\prg\utiltest.prg 
webdoc\prg\utiltest2.prg
----------------------------------------------------------------------------------------------------
webdoc\prg\handlers\                                             
----------------------------------------------------------------------------------------------------
webdoc\prg\handlers\resthandler.FXP     
webdoc\prg\handlers\resthandler.PRG     
----------------------------------------------------------------------------------------------------
webdoc\prg\handlers\lib\                                         
----------------------------------------------------------------------------------------------------
webdoc\prg\handlers\lib\resthelper.FXP  
webdoc\prg\handlers\lib\resthelper.PRG  
----------------------------------------------------------------------------------------------------
webdoc\prg\plugins\                                              
----------------------------------------------------------------------------------------------------
webdoc\prg\plugins\layouts.FXP
webdoc\prg\plugins\layouts.PRG
----------------------------------------------------------------------------------------------------
webdoc\prg\rest\                                                 
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
webdoc\prg\rest\controllers\                                     
----------------------------------------------------------------------------------------------------
webdoc\prg\rest\controllers\customers.BAK     
webdoc\prg\rest\controllers\customers.DBF     
webdoc\prg\rest\controllers\customers.FPT     
webdoc\prg\rest\controllers\customers.FXP     
webdoc\prg\rest\controllers\customers.prg     
webdoc\prg\rest\controllers\mvc.PRG     
----------------------------------------------------------------------------------------------------
webdoc\reports\                                                  
----------------------------------------------------------------------------------------------------
webdoc\reports\Web.Config     
webdoc\reports\cStampa.DBF    
webdoc\reports\gsdll32.dll    
webdoc\reports\pdfrun.exe     
webdoc\reports\doc.FRT  
webdoc\reports\doc.frx  
webdoc\reports\clsheap.FXP    
webdoc\reports\print2pdf.FXP  
webdoc\reports\pdfrun.PJT     
webdoc\reports\pdfrun.pjx     
webdoc\reports\clsheap.prg    
webdoc\reports\print2pdf.prg  
webdoc\reports\pdfrun2.tlb    
webdoc\reports\pdfrun2.VBR    
----------------------------------------------------------------------------------------------------
webdoc\temp\                                                     
----------------------------------------------------------------------------------------------------
webdoc\temp\events.CDX  
webdoc\temp\Web.Config 
webdoc\temp\cStampa61346891.DBF         
webdoc\temp\cStampa61379063.DBF         
webdoc\temp\events.DBF  
webdoc\temp\events.FPT  

New Post: Problem with printing report

$
0
0
Try putting this code right before the TRY command:
SELECT (JUSTFNAME(pathtab))
USE 
Regards

Victor Espina

New Post: Problem with printing report

$
0
0
No change, always OLE error code 0x80020006. :(

New Post: Problem with printing report

$
0
0
Try running the code inside TRY-CATCH directly from a VFP to see if the code actually works outside AVFP.

Victor

New Post: good way to host avfp web and avfp web mobile apps

New Post: good way to host avfp web and avfp web mobile apps

$
0
0
I've been using their personal plan for about two years and, despite the fact they had some serious problems with some servers last year, since then the service has been very reliable.

And the free domain is a sweet addition to the deal :)

Victor Espina

New Post: Problem with printing report

$
0
0
In VFP, oResult.log return me this:
Datasource: C:\ApplicazioniWeb\Progetti\webdoc\webdoc\temp\cStampa33290159.DBF
Format: C:\ApplicazioniWeb\Progetti\webdoc\webdoc\reports\doc.frx
Listener: Reportlistener
Printer: 35PPM PCL6
Printer1: 
Printer2: 35PPM PCL6
Printer3: FOXIT READER PDF PRINTER
Code: REPORT FORM (cReportFile)  OBJECT oListener
Datasource deleted
Completed
Would seem to be ok but doesn't print anything.

New Post: Problem with printing report

$
0
0
0x80020006. usually means it can't see the COM server either because it's not registered or some other COM error. (but mostly COM registration issues).

If you haven't manually registered the COM server, that might be an issue..

New Post: Problem with printing report

$
0
0
I don't think that's is the case here, because the code worked ok from VFP. If the COM server wasn't registered, it should had failed from VFP also. mr_ocean, please send me your FRX and a data file to my email, so I can run some tests locally.

Victor

New Post: Problem with printing report

$
0
0
vespina wrote:
I don't think that's is the case here, because the code worked ok from VFP. If the COM server wasn't registered, it should had failed from VFP also. mr_ocean, please send me your FRX and a data file to my email, so I can run some tests locally.

Victor
Ok. Can i use e-mail that i found on your website ?

New Post: Problem with printing report

New Post: Problem with printing report

New Post: Problem with printing report

$
0
0
Just received the files and found the problem. From one side, all data fields in your report where created using "alias.field" syntax, witch prevents the report to work with a data source not named "alias". From the other side, the report was saved including the printer environment, witch prevented it to use a different printer.

Once those problems were corrected, the report worked as expected.

On a side note, I just found that we can't use any PDF printer to test reporting in AVFP. No error is generated, but no printout either. The reasone, I guess, is that the STDLL does not allow the printer's save dialog to appear, so the process is not completed.


Victor

New Post: Problem with printing report

$
0
0
vespina wrote:
Just received the files and found the problem. From one side, all data fields in your report where created using "alias.field" syntax, witch prevents the report to work with a data source not named "alias". From the other side, the report was saved including the printer environment, witch prevented it to use a different printer.

Once those problems were corrected, the report worked as expected.

On a side note, I just found that we can't use any PDF printer to test reporting in AVFP. No error is generated, but no printout either. The reasone, I guess, is that the STDLL does not allow the printer's save dialog to appear, so the process is not completed.


Victor
Thanks Victor. With my previous configuration i do PDF file without problem. However, i applied the file that you send me and edited my print page but i have always the same problem: "OLE error code 0x80020006". I don't understand why i have this error in AVFP.

P.S. The printer that i use is a real printer (network printer).

P.S. 2. I removed you line with new functions that i haven't such as "AVLocate" and "AVEchoLN", etc..
Viewing all 1109 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>