Tuesday, November 27, 2007

Gotcha: VFP Reporting Bugs

I'm really frustrated that I have not received ANY response at all from Microsoft about the recent Data Group bugs I reported. I was already frustrated that they hadn't addressed any of my other report-related bugs .. but these ones are serious and were introduced by SP2.

In hopes of putting more pressure on them .. here's a list of all the bugs I have reported through the official channels. You can use the following link to go to the Microsoft Connect page. Near the bottom of the page is a place to enter the ID of the issue. Then you can rate the bug, validate it, and provide any additional comments. Maybe if enough of us complain, they will address it.

Microsoft Connect

249264 VFP Print When processing wrong parent record
291486 VFP Detail Footer Band -- Wrong record
292987 VFP Preview - Zoom level not always programmatically changeable
293615 Print When logic is evaluated at the wrong time in VFP Reports
295113 Shapes stretched across Detail Header and Detail Footer bands whacko
288896 Squished Printing
286313 VFP SYS(1037) no longer has a PRINTER button in Vista
286314 Report Properties dialog locks up
286552 Code References - error printing when not in Admin on Vista
286958 Drag control from Toolbox to Pageframe and Labels disappear
287927 Intellisense on SET gets confused
312568 SP2 broke data group headers repeated on subsequent pages
312572 Gap with multiple data groups on reports

Tuesday, November 20, 2007

Gotcha: More on the Data Group Bug

I've been trying to see if I can come up with a ReportListener that will somehow generically workaround the serious Data Group bug I previously blogged about (Data Group Bug) In the process, I tried to come up with a really good test report to make sure I'm doing it right. I created a report with 3 data groups so I can be sure my code handles multiple data groups.

Well .. let's just say I haven't even gotten to the part of writing code yet. While developing a test report, I came across ANOTHER bug related to data groups. What I'm seeing is a gap on the report after the 3rd data group header prints, but not every time. It only happens for the third data group, when it immediately follows the second data group header. Oh .. and it doesn't happen the first time for the set.

Figure 1 shows how the report looks on page 1, which is correct. Figure 2 shows what happens on subsequent pages, which is incorrect.


Figure 1 - The first page - without any gap.


Figure 2 - Subsequent pages - with a big gap!

Obviously, this whole data group issue is getting worse and worse. I'm afraid to keep working on the "workaround" code. Who knows what other bugs I'll uncover! I sure hope Microsoft fixes this! Maybe we should ALL flood them with emails about these report bugs!!

OT: The Challenges of Raising Children

Raising children certainly has its challenges, but the last week (especially the last 24 hours) was more than I needed right now in my life!

It started last Tuesday when I received a phone call from my 15-yr old son, Kyle, from the Emergency Room. He had wiped out on his gas powered scooter and injured his hand so his father took him to the ER. Kyle called me when leaving the ER and told me that his hand was broken in three places. They put a splint on it and made an appointment for him with an orthopedic specialist for Monday.

Accidents happen. Kids get hurt. I can deal with this. But I was not happy when I learned of the circumstances of this injury. Kyle has battery operated lights on the scooter so he can ride after dark. However, on this occasion the batteries were almost dead. He had asked his dad for some new batteries, but his dad didn't have any. Instead of telling Kyle he can't ride in the dark without lights, his father gave him some money and told him to ride to the store to get some. What?!?!?! His father sent him out in the dark on a scooter that goes about 35+ mph. That's ridiculous. And what happened ... There was a folding chair in the middle of the road, Kyle didn't see it, Kyle hit it, and then he went tumbling off the scooter and slid across the pavement for a while.

Then on Thursday, my 12-yr old son, Jack, came down with a cold and had to stay home from school for a few days. No big deal .. I can handle this. He went to his father's for the weekend so I made sure I informed his father that he had been sick and throwing up. Apparently his father didn't believe me. On Saturday, his father took him to Buffalo Wild Wings for lunch so they could watch the game. On Sunday, his father took him to the movies. On Sunday night, his father returned Jack to me. Despite the fact that Jack hasn't had an asthma attack in probably a year .. Sunday night, shortly after going to bed, Jack woke up with a severe asthma attack.

I tried everything but couldn't stop this attack. So .. off to the emergency room we went. They tried a different medication and were able to stop the attack. Whew .. that ordeal was over. Let's head home and try to get some sleep. Of course, by the time we got home it was 6:15 am and neither of us had gotten any sleep yet. I figured I'd keep Jack home from school again so he can rest up. Me, on the other hand, couldn't exactly do that. Kyle's appointment with the orthopedic doctor was this morning. I figured I might be able to steal 2 hours of sleep before having to get up and get ready ... but that wasn't in the cards either. An hour after I fell asleep, my phone rang 3 times in a 10 minute period. Arrgghh!! I guess I might as well give up and get out of bed.

So off to the orthopedic doctor I go to meet Kyle and his father. The doctor told us the hand was actually broken in 4 places, not 3. The doctor told us that he could either put a split on the hand, leaving his thumb and forefinger available for use, or he could put a cast on the hand, which would only leave the thumb available for use. Kyle and his father wanted the split option. I pushed for the cast. Kyle had been told by the ER to NOT remove the split and don't get it wet. Kyle, however, was non-compliant with those instructions. He removed it daily to take a shower and when he reapplied the splint, it was very loose, leaving his fingers (which were broken) loose and able to move. Now let me say at this point that Kyle has been living with his dad, and once again, his dad's poor parenting skills played into this. His father knew Kyle was doing this and didn't enforce the instructions from the ER. So based on all that information, I thought the cast was a better choice, and so did the doctor. So a blue cast was applied and we were sent on our way.

Whew, one more ordeal over with. Now to get home, get some lunch, and then try to get some sleep. Wait, I have to go pick up Jack's new prescription first. Then I'll get some sleep. While I was checking out at the counter, my cell phone rang. It was Kyle. He told me he cut his cast off. What?!?!? Are you serious?!??!? Where is your father ... let me speak to him!

Apparently, his father didn't take him back to school after the getting the cast. Instead he took him back to his place, and then left to run some errands. When he got back, Kyle had the cast off. Kyle said that it was itching and burning and he couldn't stand it. Here's where I mention that Kyle has Obsessive Compulsive Disorder (OCD) so it doesn't surprise me to know that the cast bugged him. But what did surprise me was that he went to the extreme of cutting it off with scissors, vise grips, and a saw! Oh .. and did I mention that his father had failed to fill his prescription so Kyle had not had is OCD medication in the last few days?

So much for my plans to get some sleep. I picked up Kyle and took him back to the orthopedic doctor. This time they put a splint on it .. and lectured Kyle about the importance of leaving it on and NOT removing it. I also had big plans on lecturing his father on that same issue and making sure that he assisted Kyle with wrapping it in plastic and waterproof tape before each shower. By now it's after 5:00 pm and I just want to get home and get some sleep.

It's about a 30 minute drive from the doctor's office back home, but we're in 5:00 traffic, and we came to a screeching halt. The main artery from the doctor's office to my house was completely shut down due to a major accident. They were diverting traffic down a side street which couldn't handle the flow of that much traffic. Add to that, there was a semi truck several cars in front of us and he couldn't make the turns through the neighborhood. Arrrgghh! Could this day get any worse?!?!?

I phoned Jack who was back at home and asked him to bring up MapQuest on the computer and help me out. Jack did great and gave me directions on how to get out of that mess and get home. Finally, home and exhausted. Jack and I ate a quick dinner and then went to bed ... at 8:30 pm! Thirty minutes later, the asthma attack started again! This time we were able to stop it and finally, we got some sleep.

I sure hope today is nice and calm!!!!!!!!

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!!!

Friday, November 9, 2007

Gotcha: Not all Printers Rotate the Same Direction

This is the first post in a series I'm calling "Gotcha". This is where I plan to talk about bugs ... er, "features" ... that I've run across or other issues that have caused me grief. Hopefully, by letting you know about them, and some possible work arounds, it will you save you from many future headaches!

I’ve been writing reports for years and I recently stumbled across an issue that threw me for a loop. A report that was designed on my machine in Michigan wasn’t working the same in the Tennessee home office. After a lot of hair pulling, the light bulb went off and I realized what the problem was.

To print a landscape report, my printer rotates the text counter-clockwise; the printer in the Tennessee office rotates the text clockwise!

What? You’ve got to be kidding me. How can this be? I just ASSUMED that all printers rotate the same direction! Isn’t there a “standard” or something that all printer manufacturers follow? Well .. apparently not!

So why is this important to you? The answer is … Unprintable Margins.

Most printers have unprintable margins that you have to consider when writing reports. Typically, the right and left margins are the same, but the top and bottom margins may be different. Often times, the bottom margin is the largest margin. For example, my printer has .25” on the right and left margins, .07” on the top margin, and a very greedy .48” on the bottom margin. The key here is that these figures apply to a portrait report. When you print a landscape report, these margins are swapped … and the direction of the rotation determines whether the left margin becomes .07” and the right margin becomes .48” or visa-versa.

Are you starting to see the problem yet? I designed a landscape report that was tight on the left side and had a half an inch on the right side to accommodate my greedy “bottom” margin. When my coworkers in Tennessee printed the report on their printer, the entire left side was cut off. That’s because their left margin is now the greedy bottom margin. That means they can’t print tight to the left side like I can .. but they can print tight to the right side.

So now that you know about this dilemma .. what should you do about it? You can take one of two approaches. The first approach is to design the reports as “Printable Page”, make the landscape width no more than 10.25”, and let the printer decide where to place the text. The other option is to design the report as “Whole Page” and leave a generous .5” margin on both the right and left sides of the landscape report. Personally, I prefer the latter because I like to keep the report centered, but it means I lose a little bit of real estate. Of course, if you ever run across a printer that is even greedier than mine, you’ll have to change your report width accordingly.

Knowledge is everything! Hopefully this bit of knowledge will keep you from making the same assumption I did which caused me a lot of grief and aggravation!

Thursday, November 8, 2007

Cool Tool: SlickRun by Bayden

This is the first post in a series I'm calling "Cool Tool". As a developer, I spend the majority of my day in front of a computer and I'm all for anything that helps me be more efficient. Whenever I run across a tool or utility that does just that, I'll blog about it and spread the word.

SlickRun by Bayden Systems is one such tool. Rick Strahl pointed me to this tool recently and it quickly became one of my favorites. It's a free floating command line utility for Windows and I couldn't live without it now that I have it. It's kinda like batch files on steroids. In fact, now that I have this installed, I have removed most of the icons from my desktop and I use SlickRun to launch almost everything.

Here are some examples of what I use it for:
  • I defined "Mail" to launch Outlook and open up my email

  • I defined "Music" to launch Yahoo's radio so I can
    listen to my favorite R&B station.

  • I defined "MBS" to launch remote desktop and log into
    work.

  • I defined "Time" to launch Excel and open the spreadsheet I use to track time on projects.

  • I defined "UT" to launch Explorer and open up the
    Universal Thread.

  • I defined "Word" to launch Microsoft Word.

  • I defined "Newsgroup" to launch my newsgroup reader.

You basically define a word and then tell it what to launch. And what is even cooler is that you can define one word that launches several other words. For example, I have "morning" defined to open my email, launch the internet, open up remote desktop so I can log into work, launch my time card, and a bunch of other things that I do every morning.

It also takes advantage of remembering what I typed last time so when I type "m", it displays "mail" or "music" depending on what I did last time. Often times all I have to type is one letter and it already knows what I want to do. What a huge time saver!!

So what's the cost of this great tool? Well .. what's it worth to you? Technically it's free, but donations are certainly appreciated by Bayden. I can tell you that after using this tool for just one day I sent my donation off to Bayden giving them my praise and kudos.

I consider this tool a "Must Have" and I'm sure you will too!

Monday, November 5, 2007

Hello World

I'm throwing my hat into the Blog World. Hopefully I'll be able to come up with enough things to write about on a regular basis.