2.5x 2.6x | 2.5x
WINDOWS | MACINTOSH
kbprint kbprg kbfixlist kbbuglist
The information in this article applies to:
- Microsoft FoxPro for Windows, versions 2.5x, 2.6x
- Microsoft FoxPro for Macintosh, versions 2.5x
SYMPTOMS
When you print or preview a page out of sequence in the Report Writer, the
group total reports the value from the previously processed record instead
of the actual group total.
WORKAROUND
See "Workaround" in the "More Information" section below.
STATUS
Microsoft has confirmed this to be a problem in the Microsoft products
listed at the beginning of this article. This problem was corrected in
Visual FoxPro 3.0 for Windows.
MORE INFORMATION
Steps to Reproduce Problem
- Create a new report.
- USE the INVOICES.DBF table.
- Create a data grouping based on CNO+STR(INO).
- In the Group Info dialog box, select "New Page (Page No. =1)" and
"Reprint Header On Subsequent Pages".
- Place CNO and INO in the group header band as separate fields.
- Place IDATE and ITOTAL in the Detail band.
- Place an expression, ITOTAL, in the group footer band. Choose the
Calculate check box, and then select Sum. Reset the grouping at the
CNO+STR(INO) group level.
- From the Report menu, choose Page Preview.
Note that the total on page 1 is correct.
- Using the spinner next to Page, select page 15.
Note that the ITOTAL field in the Detail band and the ITOTAL field in
the group footer band do not match.
- Look at page 14. Note that the ITOTAL field in the Detail band is the
same as the ITOTAL field in the group footer band on page 15.
This same behavior occurs when only selected pages are printed.
If you display or print pages 1-15 sequentially, all the totals are
correct.
Workaround
- Do steps 1-6 above.
- Create an expression in the group footer band that calls a user-defined
function (UDF) as follows:
pSUM(cno+STR(ino),RECNO())
- Create the UDF PSUM.PRG file as follows:
* PSUM.PRG
* ---------------
PARAMETERS mGrouping, mSavRec
SUM itotal FOR cno+STR(ino) = mGrouping TO mRetval
GOTO mSavRec
RETURN mRetval
* ---------------------
* EOP PSUM.PRG
- Preview or print the report. The totals are correct at any point.
|