Wednesday, November 14, 2007

Gotcha: Serious report bug with Data Groups introduced in VFP 9 SP2

Here's the situation: You have a report with a data group such as Customer. You checked the "Reprint group header on each page" option to make sure the group header reprints whenever the details for the group overflow to a new page. You put some total information in the group footer band. The report looks somewhat like what is in Figure 1.

Figure 1: The "Good" report

Now let's say that the data just so happens to work out so that the last detail record for customer 1 prints at the bottom of the page, thus, the data group footer needs to go to the top of the next page to print.

In VFP 7, VFP 8, and VFP 9 SP1 ... you get what's shown in Figure 2. The data group footer for customer 1 prints at the top of the next page, without bothering to reprint the data group header information for customer 1. This is a bug .. but not exactly the end of the world. I could probably live with this anomaly .. if I really had to.

Figure 2: The "Bad" report in VFP 7, VFP 8, and VFP 9 SP1

However, in VFP 9 SP2, Microsoft attempted to fix the bug and inadvertently introduced a more severe bug as shown in Figure 3. The data group header prints at the top of the next page BUT it's printing the data from Customer 2, the NEXT record. Then it backs up and the data group footer prints for Customer 1. Then the detail records for Customer 2 begin printing WITHOUT printing the data group header for Customer 2.

Figure 3: The "Bad" report in VFP 9 SP2

As you can see, this is a real mess. Printing the group header with the WRONG customer information is far worse than omitting the group header. This is completely unacceptable in my opinion!! It's completely misleading to print Customer 2 and then show the totals for Customer 1. In fact, as far as I'm concerned, it could cause some serious legal issues for my clients using my reports in some situations.

As it stands now, you cannot ever safely print data in the Data Group Header band if it's marked to repeat on subsequent pages. This is a serious bug --- and Microsoft needs to fix this ASAP!!!


Anonymous said...

Good catch Cathy. There is a Wiki page being put together with bugs at and you may want to post this information there as well.

Cathy Pountney said...

Kevin ... I added this bug to the wiki page as you suggested.

shazzb said...

What a mess. Good catch, thanks for passing it on.

Anonymous said...

Dang your beautiful!

I always wanted to say that on the UT, but of course then you'd know who I was and think to yourself "ok, this creepy guy is coming on to me", even though I'm happily & faithfully married. So, I can say it here, anonymously (even though I know that on the internet we are never completely hidden) and instead you'll say to yourself "ok, this creepy guy is anonymously giving me compliments. How creepy." J/K You've answered questions for me off and on for years (I used to be on the UT more than I am now), and I thank you for all of your help, and, the fact that you are nice to look at! ;-) oh....and yes, I think this bug is completely unacceptable as well and MS should definately fix it.... :-}

Cathy Pountney said...

Dear Anonymous,

Thank you for the compliment. And don't worry .. one compliment does not make you a stalker. Now if you start sending me private emails .. that's another thing ;-)

Garrett said...

Argh. I just got bit by this one, too, but I thought I was doing something wrong. Thanks for posting it on Connect -- I just voted and verified it.

I'm going to try to work around it by stepping forward in the Group Footer to set a variable, but I'm not terribly optimistic.

Garrett said...
This comment has been removed by the author.
Garrett said...

I removed that last comment because the solution I proposed seemed to stop working between the time I posted and the time I next ran the report. :-( It partially works, but not completely enough.

Garrett said...

Ok, this seems to work.

1) Create report variable
2) Store desired header info to it, resetting on group.
3) Edit header field to include IIF(EMPTY(reportVariable), fieldInfo, reportVariable)

Ugly, but it should work whether or not the bug is fixed.

Anonymous said...

Hi Cathy, your secret-admirer here again. :-)

Was wondering if this bug was every fixed with the resent service pack? I've noticed you've posted a workaround, and garrett did also below, but would really like it if the remaining VFP team would actually resolve this with a patch. -me

Cathy Pountney said...

Dear Anonymous,

This bug was introduced with SP2, which is the latest service pack .. so to answer your question .. no, the recent service pack has not fixed this bug. So far there is no fix available from Microsoft. However, I am hopeful that it will be addressed in the near future and I am anxiously waiting for something official.

Anonymous said...

Hi Cathy, and thank you for the info :-)
Are there some (good) news after a year from the last post ?

P.S.: I'm another Anonymous, NOT the creepy one !! :-D

Cathy Pountney said...

Dear "Another Anonymous",

This bug has been fixed with a patch that was released in April 2009. I made a few blog posts about it in April.

As far as new things ... come to Southwest Fox in October and I'll be showing some really cool reporting stuff with SP2. Most people don't realize that SP2 included a ton of enhancements for the Report Writer!

Anonymous said...

Great !! :-)

From now on I will read your blog entirely before asking something !! :-D

Thank you :-)