checkered sheet of paper from EASYREPORT

checkered sheet of paper from EASYREPORT

Postby Otto » Fri Nov 24, 2017 5:39 pm

Hello,

for an intern report I needed a checkered sheet. Attached is the code I use.
EasyReport is very powerful.


Code: Select all  Expand view

function f_druck( cDbf )
    local oVRD
    local lPreview := .t.
    local cDruckerName := ""
    local I := 0
    local cTempRow := ""
   *----------------------------------------------------------

    #define ER_AR_Rechnungskopf_v01 1
    #define ER_AR_Invoice_v03           3
    #define ER_AR_Schatten_v05          5
    #define ER_AR_Linie_v04             4
    #define ER_AR_Linievertikal_v06 6
    #define ER_AR_Rahmen_v07            7

    TPreview():lListViewHide := .T.
   
    EASYREPORT oVRD NAME ".\xVrd2\invoice.vrd"  PREVIEW  lPreview TO cDruckerName;
                PRINTDIALOG IIF( lPreview, .F., .F. ) MODAL

    PRINTAREA ER_AR_Rechnungskopf_v01 OF oVrd

    PRINTAREA ER_AR_Schatten_v05 OF oVRD
   
    cTempRow := ALLTRIM( STR( oVRD:nNextRow - 3 ) ) 
    For I := 1 to 17
        PRINTAREA ER_AR_Linie_v04 OF oVRD
     NEXT
   
    WritePProString( "General", "Top1", cTempRow , ".\xVRD2\invoice.v07" )
    PRINTAREA ER_AR_Rahmen_v07 OF oVRD

    WritePProString( "General", "Top1", cTempRow , ".\xVRD2\invoice.v06" )
    PRINTAREA ER_AR_Linievertikal_v06 OF oVRD

    PRINTAREA ER_AR_Invoice_v03 OF oVRD
   
   oVRD:End()

    #UNDEF ER_AR_Rechnungskopf_v01 
    #UNDEF ER_AR_Invoice_v03           
    #UNDEF ER_AR_Schatten_v05          
    #UNDEF ER_AR_Linie_v04             
    #UNDEF ER_AR_Linievertikal_v06 
    #UNDEF ER_AR_Rahmen_v07            

return nil

 


The design of EasyReport is made the way that you have to use numeric values in the configuration file for areas and items.
The configuration files are INI-files. You can use WritePProString and GetPvProfString.

Every PRINTAREA is stored in a single file.
In the REPORT Definition file ReportName.vrd is a key
[Areas] where you see a list with the PRINTAREA files of this report
1=invoice.v01
2=invoice.v02
3=invoice.v03
4=invoice.v04
5=invoice.v05
6=invoice.v06
7=invoice.v07

Area and Item method use numeric values.

For me the best solution to get a readable source code is to use defines (#define).

PRINTAREA 1 OF oVrd is not very userfriendly.
-----------------------------------------------------------------------------

I define the Print Areas and Items

#define ER_AR_Rechnungskopf_v01 1

and use

PRINTAREA ER_AR_Rechnungskopf_v01 OF oVrd


ER_AR_ I use for example for print area
Rechnungskopf is the task what the area prints
v01 for the configuration file.
This is helpful to find the corresponding configuration file. Many times I edit the vrd files with my text Editor (FE). This is for some tasks easier and faster.


A short explanation of what I am doing.
1) In my code before the checkered sheet is printed I store the row from the pervious AREA .
cTempRow := ALLTRIM( STR( oVRD:nNextRow - 3 ) )

( oVRD is the REPORT object with all printing Information. Please look into vrd.prg and itemvrd.prg from EasyReport ).


2) Here I change the Top1 value of the PRINTAREA. I print one layer (printarea) over the other.

First the vertical lines
WritePProString( "General", "Top1", cTempRow , ".\xVRD2\invoice.v07" )
PRINTAREA ER_AR_Rahmen_v07 OF oVRD

Then the border
WritePProString( "General", "Top1", cTempRow , ".\xVRD2\invoice.v06" )
PRINTAREA ER_AR_Linievertikal_v06 OF oVRD

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: 6312
Joined: Fri Oct 07, 2005 7:07 pm

Re: checkered sheet of paper from EASYREPORT

Postby Silvio.Falconi » Sat Nov 25, 2017 9:07 am

Nice Otto.
My dear friend Otto, I might also like ER but I could not complete the program in Harbour, I wanted the full version without the latest additions, I wanted to see if I could add ER in my applications but I did not succeed. It is difficult to draw an invoice or an order. In Italy the bills have the VAT rates grid because each product could have its own iva so I had to draw in the foot a grid with Imponable, aliquota and percent but I did not succeed.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7033
Joined: Thu Oct 18, 2012 7:17 pm

Re: checkered sheet of paper from EASYREPORT

Postby Otto » Sat Nov 25, 2017 10:17 am

Hello Silvio,
please post a screenshot. I will try to design this footer.

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

Re: checkered sheet of paper from EASYREPORT

Postby Silvio.Falconi » Sat Nov 25, 2017 11:04 am

Image

think
each product have a tax you must calc the sum for this tax
I have that values on a array..I make a cicle to calc subtotals
generally we insert until 4 tax different
Imponibile is the total of invoice with no total tax
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7033
Joined: Thu Oct 18, 2012 7:17 pm

Re: checkered sheet of paper from EASYREPORT

Postby Otto » Sat Nov 25, 2017 3:18 pm

http://www.atzwanger-software.com/fw/yunus2.zip

Hello Silvio,
I uploaded a working sample to our server.
This is Yunus.prg extended with EASYREPORT.
Copy the files into your fivewin sample folder.
You have to link in vrd.lib ( from sources of github repository ) to your build.bat.
I use xHarbour.
Copied xvrd.lib into FWH\lib, vrd.ch to the include folder and
added
echo %fwh%\lib\xvrd.lib + >> b32.bc

Here you see the source for the footer. The VRD files are in the folder xVRD.
Hope this works for you.
Best regards,
Otto

//----------------------------------------------------------------------------//
//Footer
//----------------------------------------------------------------------------//

Code: Select all  Expand view
#DEFINE ER_BASE            310
 #DEFINE ER_VAT            311
 #DEFINE ER_TOTALVAT       312
 #DEFINE ER_TOTALINVOICE   313



     
      PRINTAREA 4 OF oVRD ;
               ITEMIDS    { ER_BASE ,;
                                     ER_VAT ,;
                                    ER_TOTALVAT ,;
                                    ER_TOTALINVOICE  } ;
               ITEMVALUES { cValToStr( oBrw:Amount:Value ) ,;
                                    cValToStr( oBrw:TaxRate:Value ) ,;
                                    cValToStr( oBrw:Tax:Value ) ,;
                                    cValToStr( oBrw:Total:Value )  }
                                   




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

Re: checkered sheet of paper from EASYREPORT

Postby Silvio.Falconi » Mon Mar 19, 2018 8:01 am

Itried but there is a error

Application
===========
Path and name: C:\Users\admin\Downloads\yunus2\silvio\yotto.exe (32 bits)
Size: 5,843,968 bytes
Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20150712)
FiveWin Version: FWHX 16.10
Windows version: 6.2, Build 9200

Time from start: 0 hours 0 mins 2 secs
Error occurred at: 19/03/2018, 09:01:01
Error description: Error BASE/1004 Class: 'NIL' has no exported method: EDITSOURCE
Args:
[ 1] = U
[ 2] = L .T.

Stack Calls
===========
Called from: => EDITSOURCE( 0 )
Called from: yotto.prg => (b)BRWBTNBAR( 736 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK( 658 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP( 894 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1721 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT( 1836 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3305 )
Called from: => WINRUN( 0 )
Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE( 1042 )
Called from: yotto.prg => MAIN( 32 )
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7033
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 49 guests