Page 1 of 1

Possible improvement to TReport

Posted: Tue Oct 06, 2009 11:05 am
by Enrico Maria Giordano
The following sample stops with an error:

Code: Select all | Expand

#include "FiveWin.ch"
#include "Report.ch"


FUNCTION MAIN()

    LOCAL oPrn

    PRINT oPrn TO "PDFCreator"
        REP01( oPrn, "1" )
        REP01( oPrn, "2" )
    ENDPRINT

    RETURN NIL


FUNCTION REP01( oPrn, cNum )

    LOCAL oReport

    USE TEST

    REPORT oReport TITLE  "TEST" + cNum TO DEVICE oPrn

    COLUMN TITLE "St"         DATA Test->State
    COLUMN TITLE "First Name" DATA Test->First
    COLUMN TITLE "   Salary"  DATA Test->Salary

    END REPORT

    oReport:CellView()

    ACTIVATE REPORT oReport

    CLOSE TEST

    RETURN NIL


The reason is that the printer is closed in End() method. Can it be closed only if it is not provided externally through the TO device clause?

EMG

Re: Possible improvement to TReport

Posted: Tue Oct 06, 2009 2:21 pm
by MarcoBoschi
Enrico,
in my opinion is very useful to concatenate more reports into a single one!
Thanks for your interest.

marco