Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Indexing multipage text slabs
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01036224
Message ID:
01036886
Views:
9
Hi Rex,
Here my changes to your PRG. It is worked, but has one proble I can't figured out how to resolve. IF the user doesn't skip through ALL pages only these <> will be appended to the file, but if this is ONLY for printing report (I mean no Preview) then no such a problem will occures.

Here my changes:
CLOSE DATABASES
MXTEMPFILES = SYS(5) + SYS(2003) + "\"
cFile = MXTEMPFILES + "memofile.DBF"
USE (cFile) IN 0 ALIAS memofile

** set up temporary name index data file
cFile = MXTEMPFILES + "DECINDEX.DBF"
IF FILE(cFile)
   ERASE (cFile)
ENDIF

cFile = MXTEMPFILES + "DECINDEX"

** FREE just in case you have some open DATABASE (I know you started
**  with CLOSE DATA, but ... Just in case
CREATE TABLE (cFile) FREE ;  
    (section C(21), name C(50), page C(5), fname C(40), lname C(30))

* Index the table because if the use skip through all the pages in report and then
* Decide to skip back the names are appened again
INDEX ON Name TAG DECINDEX 
USE
USE (cFile) ORDER DECINDEX IN 0 ALIAS decindex


** this record has a large memo
cRNo = "01100"  


**** Creating the cursor used for REPORT
CREATE CURSOR cReport (Memo M)
SELECT memofile
nLines = ALINES(arrLines,memofile.memo,.t.,CHR(13))
FOR asd = 1 TO nLines
    INSERT INTO cReport VALUES (CHRTRAN(arrLines[asd],CHR(10),[]))
NEXT
SELECT cReport

cReportName = MXTEMPFILES + "memo"
REPORT FORM (cReportName) PREVIEW
CANCEL

**********************************************************
**********************************************************
FUNCTION eIndex(lcName)
   
   lcFName = LEFT(lcName,AT("/",lcName)-1)
   SEEK PADR(lcFName,50) IN decindex
   IF NOT FOUND("decindex")
      lcLName = SUBSTR(lcName,AT("/",lcName)+1)
      APPEND BLANK IN decindex
      REPLACE name  WITH lcLName + "," + lcFName,;
              page  WITH TRANSFORM(_pageno),;
              fname WITH lcFName,;
              lname WITH lcLName IN decindex
   ENDIF

   RETURN ""
ENDFUNC
**********************************************************
**********************************************************
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform