EasyReport

EasyReport

Postby Otto » Tue Aug 04, 2009 10:09 pm

Hello Timm,
I would like to use for EasyReport the following syntax too.
Normally you have to use:

Code: Select all  Expand view
PRINTAREA  1   OF oVRD  ;
   ITEMIDS    { …    } ;
   ITEMVALUES {}


Code: Select all  Expand view
PRINTAREA “MYHEADER.V01”   OF oVRD  ;
   ITEMIDS    { …    } ;
   ITEMVALUES {}



User-friendly names would be more clear.

I changed the method AreaStart to:

Code: Select all  Expand view
METHOD AreaStart( nArea, lPrintArea, aIDs, aStrings, lPageBreak ) CLASS VRD
   LOCAL i
   LOCAL nRecords   := 0
   LOCAL nCondition := 0
   LOCAL nPrBefore  := 0
   LOCAL nPrAfter   := 0
 
    if VALTYPE(nArea) = "C"
        nArea := ASCAN( ::aAreaInis,  Upper( ::cAreaFilesDir + nArea ) )
    endif
 
    nRecords   := IIF( ::aControlDBF[nArea] = 0, 1, ::aDBRecords[ ::aControlDBF[nArea] ] )          
    nCondition := VAL( GetPvProfString( "General", "Condition", "1", ::aAreaInis[nArea] ) )          
    nPrBefore  := VAL( GetPvProfString( "General", "PrintBeforeBreak", "0", ::aAreaInis[nArea] ) )  
    nPrAfter   := VAL( GetPvProfString( "General", "PrintAfterBreak" , "0", ::aAreaInis[nArea] ) )  
 
    DEFAULT lPageBreak := .F.

   ::nCurArea   := nArea



It is working.

Timm would you be so kind to review the code.

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

Re: EasyReport

Postby Otto » Wed Aug 05, 2009 7:57 am

Another idea which I think of is to change the
Method new and to dimension the AREAS by default to 100 and change the method like this:

//Areas
::aAreaInis := {}

//new code
::aAreaInis := ARRAY(100)


aIniEntries := GetIniSection( "Areas", ::cDefIni )

FOR i := 1 TO 100
//new codeline
::aAreaInis[I] := "-"

cDef := ALLTRIM( GetIniEntry( aIniEntries, ALLTRIM(STR( i, 5)) , "" ) )

IF .NOT. EMPTY( cDef )

cFile := VRD_LF2SF( ::cAreaFilesDir + cDef )

IF FILE( cFile ) = .F.
AADD( ::aErrors, "2" + CHR(9) + "Area ini file not found: " + cDef )
ENDIF

// AADD( ::aAreaInis, cFile )
//changed
::aAreaInis[I] := cFile

ENDIF

NEXT



Then you could

Use:
#define MY_HEADER 50
#define MY_UNIVERSAL_TITLE 51
#define MY_COPYRIGHT 52




PRINTAREA MY_COPYRIGHT OF oVRD ;
ITEMIDS {…} ;
ITEMVALUES {…}


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


Return to FiveWin for Harbour/xHarbour

Who is online

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