Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printed report with record more than a page (memo field)

Status
Not open for further replies.

diemtranrms

Programmer
Jun 5, 2015
7
VN
Hi,
I have some problems when printed report (Visual Foxpro 8.0 Which I am using)
The Report has 2 groups (Group A,B) is order on layout as below:
=====
Page Header
GroupHeader IndexA
GroupFooter IndexA
GroupFooter IndexB (Field:Narrative (memo field) and rectangle for this field, and I check "Start each group in new page")
PageFooter (Fileds: PF1, PF2)
=====
Described data: there are 3 records (IndexB1, IndexB2, IndexBFinal) for Group Footer IndexB. The Narrative field of IndexBFinal has data more than a page (3 pages).
The problems occurs when print the report to pages of IndexBFinal record.
1. In the PageFooter section , the PF1, PF2 fields only display data in last page and do not display data in the page 1, page 2.
2.With Print when (NOT ISNULL(IndexBFinal) AND NOT EMPTY(IndexBFinal), the rectangle (frame) of Narrative field does not display from page 2, only print at page 1.
3. With Print when (NOT ISNULL(IndexBFinal) OR NOT EMPTY(IndexBFinal), the blank rectangle will print at last record of GroupFooter A (this is incorrect), and print rectangle in 3 pages of IndexBFinal record (this is correct).
I think that with problem#1,because I put memo field which has more than a page at group footer so happen error. I also put memo field at group header,do not happen occur, but this do not correct structure of my report.
With problem#2,#3, I think that when print to page 2, IndexBFinal value is not exist (this is eof)
I have spent a long time to solve these, Could you please support me about these?Thank so much.



 
I have seen this before, I break the memos up into individual lines and put them into the cursor as records.

That way the memo can be a novel and it still gets printed.

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are not good for you.
 
Hi GriffMG,
I created cursor which save data of Memo field, but the problem still occur.
"CREATE CURSOR cCaseNarr(IDNarr C(5),NarrCaseRep M(4)) from Memotable
...."
And I don't understand your instruction "break the memos up into individual lines and put them into the cursor as records."
Could you please support detail to me "How to break the memos up into individual lines and put them into the cursor as records?". Thanks for your help.
 
Make a cursor with a single record for each line in your memo field.

Use MemLines() to determine the number of lines in your memo, taking care to set MEMOWIDTH to something appropriate
then use MLINE(NarrCaseRep,index) to access each line and store it in a new cursor, a bit like this untested approach

Code:
select 0
create cursor cCaseNarr (IDNarr C(5),NarrCaseLine C(240))
select MemoTable
go top
do while .not. eof()
  scatter to tmpfields memo
  select cCaseNarr
  append blank
  gather from tmpfields memo
  replace NarrCaseLine with MLINE(memoTable.NarrCaseRep,1)
  for I = 2 to memlines(MemoTable.NarrCaseRep)
    append blank
    gather from tmpfields memo
    replace NarrCaseLine with MLINE(memoTable.NarrCaseRep,I)
  next
  select MemoTable
  skip
enddo

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are not good for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top