mod harbour PDF and PRINT

mod harbour PDF and PRINT

Postby Otto » Fri Aug 30, 2019 9:48 pm

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
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6330
Joined: Fri Oct 07, 2005 7:07 pm

Re: mod harbour PDF and PRINT

Postby Otto » Fri Aug 30, 2019 9:54 pm

Code: Select all  Expand view

/*
****************************************************************************
*   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
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6330
Joined: Fri Oct 07, 2005 7:07 pm

Re: mod harbour PDF and PRINT

Postby Massimo Linossi » Sat Aug 31, 2019 4:46 pm

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
Massimo Linossi
 
Posts: 498
Joined: Mon Oct 17, 2005 10:38 am
Location: Italy

Re: mod harbour PDF and PRINT

Postby Otto » Sun Sep 01, 2019 9:36 pm

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

Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6330
Joined: Fri Oct 07, 2005 7:07 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 86 guests