Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Memo Field on Report gets truncated
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Divers
Thread ID:
00039327
Message ID:
00039422
Vues:
33
>I have a report form fed by a table using the command REPORT FORM rpt TO PRINTER
>
>On this report is a memo field, lately the engineers have been getting very verbose,
>(using the more I say the better they will understand rule) when entering data into
>this field. Now I have a report that is truncating the memo field when the report is printed.
>I would like the report to print the footer data and continue printing the memo field on
>the next page.
>
>Does anyone know how this can be done. I already have the field on the report as being
>stretchable. What else do I need.
>
>TIA

Is your memo field in a group footer? If so, I don't think you can get it to work. I think it needs to be in the detail line to stretch. Also, if you have page numbers in your page footer, when the memo field stretches to the next page, the page number will not advance (you get two 'Page 2's for example). The only way I have found to overcome this has been to split the larger memo fields into two separate records. Here's my code for just such a situation. You set your memowidth the the maximum number of characters that fit across your page width. (If you are using a proportional font it's safer to lowball the number but you get some unsightly hard returns.) Then figure out how many lines will fit on a page (in the example, the line length is 114 and the number of lines is 26).

* count lines in the memo field and split it up (for page numbers)
set memowidth to 114
lncount = reccount()
go top
SCAN for recno() <= lncount
lnrec = recno()
lnchar = 0
IF memlines(p4_text) > 24
scatter memvar memo
newtext = ""
FOR i = 1 to 26
newtext = newtext + IIF(!empty(newtext),chr(13), "")+mline(m.p4_text,i)
ENDFOR
go lnrec
replace p4_text with newtext
lnlast = memlines(m.p4_text)
FOR i1 = 27 to lnlast step 26
newtext = ""
lnend = IIF(lnlast<=i1+25,lnlast, i1+25)
FOR i2 = i1 to lnend
newtext = newtext+IIF(!empty(newtext),chr(13), "")+mline(m.p4_text,i2)
ENDFOR
insert into printp40 from memvar
replace p4_text with newtext
ENDFOR
go lnrec
ENDIF
ENDSCAN

Someone else might have a more elegant solution, this was the best I could come up with when I had to do it. This should also work if you want to keep the memo field in a group footer, but the size of your field in the report format has to be the maximum number of lines that fit.

HTH,
Valerie
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform