FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour more report on the same document PDF
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
more report on the same document PDF
Posted: Mon Oct 05, 2009 02:58 PM

Hi,
I have to create more report on the same PDF file.
I use PDFCReator as printer.
I modified rep01.prg sample in samples\report folder I tried this:

include "FiveWin.ch"

include "report.ch"

FUNCTION MAIN()
LOCAL oPrn
LOCAL oReport1
LOCAL oReport2

PRINT oPrn TO "PDFCreator"

USE TEST

REPORT oReport1 TITLE " SECONDO REPORT " TO DEVICE oPrn

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

END REPORT

ACTIVATE REPORT oReport1

GO TOP

REPORT oReport2 TITLE " SECONDO REPORT " TO DEVICE oPrn

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

END REPORT

ACTIVATE REPORT oReport2

CLOSE DATABASE

RETURN NIL

I have this error
Application
===========
Path and name: C:\FWH\samples\report\rep01.exe (32 bits)
Size: 1,868,800 bytes
Time from start: 0 hours 0 mins 0 secs
Error occurred at: 10/05/09, 16:56:55
Error description: Error BASE/1605 Invalid self: NEW
Args:
[ 1] = O TREPORT
[ 2] = U

Stack Calls

Called from: .\source\classes\REPORT.PRG => TREPORT:NEW(286)
Called from: .\source\classes\PDREPORT.PRG => RPTBEGIN(44)
Called from: rep01.prg => MAIN(25)

Marco Boschi
info@marcoboschi.it
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: more report on the same document PDF
Posted: Thu Oct 08, 2009 12:37 AM

Marco,

This is just a wild guess, but perhaps the first report is still running when the second report starts. You could try something like:

do while oReport1!=nil
waitseconds(1)
enddo

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10

Continue the discussion