Page 1 of 1

mod harbour PDF and PRINT

Posted: Fri Aug 30, 2019 9:48 pm
by Otto
Hello,
today I made a report modul for my DOS Clipper Fibu (Accounting System) in mod Harbour.

Best regards
Otto

Image

Image

Image

Re: mod harbour PDF and PRINT

Posted: Fri Aug 30, 2019 9:54 pm
by Otto

Code: Select all

/*
****************************************************************************
*   Aplicacion: Test jQuery DataTable con Ajax para mod_harbour            *
*       Fuente: data1.prg                                                  *
*        Autor: Joaquim Ferrer Godoy                                       *
*       Inicio: 06-08-2019                                                 *
****************************************************************************
*/
function main()
    
    local   hData := {=>}   
    local hItem
    
    USE ( hb_GetEnv( "PRGPATH" ) + "/../data/aj.dbf" ) ALIAS "data" SHARED
    set order to tag ktonr
    hData['data'] := {}
    
    if rlock()
        
        do while !eof()
            hItem := {=>}   
            hItem['beldat']         := data->beldat
            hItem['konto']          :=  rtrim(data->ktonr) 
            hItem['text']           := convertXML( data->text )
            if data->S_H = 1
                hItem['soll']       := data->betrag
                hItem['haben']      := 0
            else
                hItem['soll']       := 0
                hItem['haben']      := data->betrag
            endif
            hItem['gg_ktonr']       := data->gg_ktonr
            
            aadd( hData['data'], hItem )
            dbskip()
        enddo
        dbunlock()
    endif   
    CLOSE 
    
    AP_SetContentType( "application/json" )
    
    ?? hb_jsonEncode( hData, .T. )  // T=pretty
    
return NIL

function convertXML( cVData )
    local I := 0
    *----------------------------------------------------------
    
    cVData  :=  STRTRAN(cVData, chr(228), "ä"   )
    cVData  :=  STRTRAN(cVData, chr(246), "ö"   )
    cVData  :=  STRTRAN(cVData, chr(252), "ü"   )
    
    
    cVData  :=  STRTRAN(cVData, chr(142), "Ä"   )
    cVData  :=  STRTRAN(cVData, chr(153), "Ö"   )
    cVData  :=  STRTRAN(cVData, chr(154), "Ü" )
    
    cVData  :=  STRTRAN(cVData, chr(223), "ß" )
    
return (cVData)




 

Re: mod harbour PDF and PRINT

Posted: Sat Aug 31, 2019 4:46 pm
by Massimo Linossi
Hi Otto.
Nice work, many compliments.
Is the saving to Excel working ? Because I've tried to convert a working function that opens a dbf and writes directly to Excel
files with ole but I receive an error with the oExcel:save command saying that the function is not found.
Thanks
Massimo

Re: mod harbour PDF and PRINT

Posted: Sun Sep 01, 2019 9:36 pm
by Otto
Hello Massimo,
for me it is working fine.
Best regards
Otto

Image