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!

Page footer prints incorrectly when memo field has long text in group footer.

Status
Not open for further replies.

diemtranrms

Programmer
Jun 5, 2015
7
VN
Hi everyone,
Could you please help me how to display data correct in the page footer when the group footer has record with memo field more than a page?. Currently,I’m working in report visual foxpro 8.0.
The report has a group which is grouped by CAT_ID field (CATEGORY. CAT_ID) designed as below:
Page Header
Group Header
Group Footer- the description field (CATEGORY.CAT_DESC) is a memo field which prints data on 2 pages
Page footer- Input_Date (CATEGORY.Input_Date), (CATEGORY.Last_Update) fields.
Observed: Page footer does not display data in first page.
I expect that the Page footer display data in 2 pages.
Thanks a lot.
 
I think you need to find a way to move the memo fields out of the footer, VFP doesn't not cope well with variable footer sizes.



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 !good for you.
 
Check out whether there is sufficient space available for group footer to print in page or not. If not then print group footer on the next page.

To find available height :

In group footer place a shape object and created an instance of reportlistener's class.Reportlistener have AdjustObjectSize Events which is called to adjust size of the shape object at runtime.
In this event ,Parameter Object oObjProperties have 1 property- "maxheightavailable" which is useful to find out available room on this page for this element, so at each element check whether space for printing memo field was less than available space or not . If not then make height of the shape object = maxheightavailable which filled rest of the page space and forced underlying field (make object position to float) to print on the next page.

---> I have discussed it in my previous thread - thread184-1769124
 
Does the problem arise because there is insufficient space to print the group footer on the current page? That is, the vertical space below the last detail in the previous group and above the current page's footer is less than the height of the group footer?

If so, consider setting the "start group on new page when less than:" control (on the Data Grouping tab of the Report Properties).

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Thanks all.
The group footer is setting 'Start each group in new page'. It seems that the VFP does not support to print all pages in footer when group footer has additional pages. (The report only print data for the last page in page footer)
As structure of report is requested, I can not move the memo fields out of the group footer. So, my approach to solve problem is creating cursor to break the memos field up into individual lines how use MLINE to access each line and store it in a cursor as GriffMG's instruct in thread The codes as below:
====================
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
==============
However, with the code I only solve with a CATEGORY. But when printed report with many CATEGORYs, the report can not print and the VFP is hang because the code is not exist do...while loop. Now, I am finding a way to point correctly cursor into every CATEGORY which memo field (CATEGORY.CAT_DESC) has long text in group footer.
Could you please any ideas to print report with many CATEGORYs?. Thanks for all supports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top