mod harbour PDF and PRINT

Post Reply
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

mod harbour PDF and PRINT

Post 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
Last edited by Otto on Fri Aug 30, 2019 9:59 pm, edited 1 time in total.
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: mod harbour PDF and PRINT

Post 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)




 
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
Massimo Linossi
Posts: 474
Joined: Mon Oct 17, 2005 10:38 am
Location: Italy

Re: mod harbour PDF and PRINT

Post 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
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: mod harbour PDF and PRINT

Post by Otto »

Hello Massimo,
for me it is working fine.
Best regards
Otto

Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
Post Reply