Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Page Footer does not fire on last page
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00941905
Message ID:
00942133
Views:
51
This message has been marked as the solution to the initial question of the thread.
Hi Scott.
I was experiencing something similar, and workarounds are as follows:

1. Set up a text Box on detail band under normal detail band details and ensure its depth is deeper than Group Footer Band. Put in a Print When = .f.
(This seemed to correct my problem,,, I've no idea why though)

2. Set up a loop which prints One Form at a time
.i.e. say All records are in a Cursor called MyCur
Select MyCur
Goto top
Do while not eof()
lnRecnum = Recno()
Copy to temp for recno() = lnRecnum
Select 0
Use Temp
Report Form MyForm

Select MyCur
SkiP
Enddo

(Above code means only one form is printed each time)

Regards,

Gerard



>From the start, let me note this is NOT an issue with a "Print When", or "Remove Line If Blank", or empty data fields, or "Whole Page" versus "Printable Page". I've already considered those. Deep thinkers, read on...
>
>I am printing invoices (older VFP 6 app) that have each invoices totals in the page footer (so they will always show at the bottom). I found some bugs, and was almost able to work around them, but not quite.
>
>First of all, the report may be printing a batch of invoices, and I have one cursor with all the data for header and detail ordered by invoice number. My Detail band and Group Footer band (based on invoice #) have memo fields that stretch. Sometimes they run down far enough on the page to push the invoice Group Footer to another page.
>
>In these cases, the Page Header and Group Footer always shows the right data for that invoice, but the Page Footer may show the totals of the next invoice. Tracing this shows the Page Footer on that second page has already skipped to the next record. I proved this by displaying the Invoice number in each band.
>
>Example:
>-- Page 1 --
>Page Header Band - Invoice 1001
>Group Header - Invoice 1001
>Detail - Invoice 1001
>Detail - Invoice 1001
>Detail - Invoice 1001 (all details got printed)
>Page Footer - Invoice 1001
>-- Page 2 --
>Page Header Band - Invoice 1001
>Group Footer - Invoice 1001
>Page Footer - Invoice 1002 (ahhh, already skipped)
>-- Page 3 --
>Page Header Band - Invoice 1002
>Group Header - Invoice 1002
>Detail - Invoice 1002 (all details got printed)
>Group Footer – Invoice 1002
>Page Footer - Invoice 1002
>

>I tried to fix Page 2 Footer by running a group footer on-entry function to save the current record to an object (SCATTER NAME) and using the object properties to show in the footer. This solves one problem but manifests another:
>
>-- Page 1 --
>(same)
>-- Page 2 --
>Page Header Band - Invoice 1001
>Group Footer - Invoice 1001
>Page Footer - Invoice 1001 (work-around shows saved object data)
>-- Page 3 --
>Page Header Band - Invoice 1002
>Group Header - Invoice 1002
>Detail - Invoice 1002 (all details got printed)
>Group Footer – Invoice 1002
>Page Footer - Invoice 1001 (arghh!! it repeated Page 2!!)
>

>RATS. Notice now that the Page Footer on the last page now shows my object data instead of the true 1002 record data. Another trace shows the Page Footer is not even firing on the last page, but rather repeating data from the prior page. I put a logging function in each band to save to a text file, AND I added a separate page SUMMARY band to see if that would help (but it didn't):
>
>LOG.TXT
>Page Header - 1001
>Group Header - 1001
>Detail - 1001
>Detail - 1001
>Detail - 1001
>Page Footer On Entry - 1001
>Page Footer - 1001
>Page Footer On Exit – 1002 (skipped records already)
>Page Header – 1001 (back to first)
>Group Footer - 1001
>Page Footer On Entry – 1002 (oops, skipped again)
>Page Footer - 1002
>Page Footer On Exit - 1002
>Page Header - 1002
>Group Header - 1002
>Detail - 1002
>Group Footer - 1002
>Page Footer On Entry - 1002
>Page Footer On Exit - EOF
>Summary
>

>You can see on first page the Page Footer skips records after Footer but before On Exit, then reverts back in next Page Header. Note also the Page Footer On Entry/Exit fire on last page, but the band itself is not rendered. It's almost like the bands each have their own record pointer and restores their saved position.
>
>I’ve tried skipping -1 during the Page Footer if Invoice number is different from Page Header, but this throws it into a tizzy and it keeps repeating the first invoice forever. Unfortunately too, I have not re-produced this report outside of the live customer database because of it's complexity. I may try to do that later.
>
>Anyone have an idea why it happens and other work-around options?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform