Click here to Skip to main content
15,894,955 members
Articles / Programming Languages / SQL

Solving a Nasty Bug in VS2005 Crystal Reports

Rate me:
Please Sign up or sign in to vote.
2.00/5 (7 votes)
23 Jun 2010CPOL4 min read 29.1K   14   8
Crystal Reports producing odd results? Don't do what we did!

Introduction

Problems with Crystal Reports in VS2005? Odd results? You might be able to save yourself from the stupidity I have just been through...

Background

Although this is an adventure in stupidity (on our part), we are presenting this here at CodeProject to maybe save some other poor soul later on who falls into the same trap we did.

The problem? You use Crystal Reports that comes with Visual Studio 2005 to develop some reports for your application. In our case, we were building a reporting tool that takes SQL Server data sets and, through stored procedures, feeds the Crystal Reports.

Life was good right up until we started distributing the reports - even in-house. That is, the reports worked and looked great on one machine running a local instance of SQL Server, but as soon as we moved the application for testing, weirdness arrived.

On any other machine, our reports continued to use the stored procedures and data looked fine, but the parameters from our application used to generate the reports did not show in the report headers! Clearly, the underlying SQL had the parameters because data was the same on any machine, any instance of SQL Server. But on any machine other than that machine where the reports were designed and produced, the Report Headers did not show the parameters.

Using the Code

For two weeks, we tried everything we could think of to debug this problem. We tweaked code again and again and wrote various interrupts to see what was happening to those parameters!

We contacted Business Objects and reported the problems and then spent days (!!!) monkeying around with them trying to confirm our registration number. (In fact, these guys spent MORE time playing registration games with us than helping - and wait until you hear the "fix").

On a Friday afternoon, I had to report to our company President that though we had the application and the reports done, we had a nasty bug that prevented any release. We had tried some very complex solutions - nothing worked. I was pretty sure my head would roll because this was an important application that a client was waiting for. The company President said 'stick with it' and gave us a weekend's breathing space.

On a whim, I called an old friend on Saturday and was talking to him about this. He had never heard of such a problem but at one point casually asked "did you check for any Service Packs for Crystal Reports?" I said no, not directly, but that I was pretty sure we were up to date on Service Packs (thinking correctly that the Visual Studio Service packs would have included any Crystal Reports Service packs)...

They didn't - and THERE is the solution.

I went to the office on Saturday, went to the Business Objects site and scoured it for any Service Pack for Crystal Reports for VS2005. Indeed, there was one. I installed the Service and voila, the problem went away - parameters now printed out just fine.

Obviously, only a developer could be as stupid as I was - seeking complex solutions to an easy problem. I've been at this game for decades, and yet again, there I go frustrating myself never presuming to check the easiest thing first.

Points of Interest

Moral of the story? Don't be stupid like me. Don't write tons of code to check and hopefully resolve a problem. Use the KISS (Keep it simple stupid!) principal first.

If anyone is having oddities with Crystal Reports for VS2005, make sure (first thing!) that you are fully up to date with Service Packs and DO NOT depend on just Microsoft's packs - go to the Business Objects site (www.BusinessObjects.com) and check for any updates.

Thanks to a friend, my job was saved and we are running fine now. And once again, I have learned that the easiest solution is usually best checked first, NOT weeks after wasting hours and hours trying to resolve something.

And oh yes, if you go to the Business Objects site looking for help, be sure to be prepared to get no help without a blood test, urine sample, offer of your firstborn, and probably more as these boneheads could not answer a simple question without first doing more background checking than the FBI does on world renowned terrorists. Had they simply asked "are you up to date on OUR Service packs" it would have saved days I spent trying to give them all the information they wanted just so I could ask my simple question.

Support? They don't know the word - but alas - my stupidity is at fault too...

I hope no one else has to deal with a mess like this has been!

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Unknown
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralJust One Exception :-( Pin
azam31630-Dec-10 4:08
azam31630-Dec-10 4:08 
GeneralRe: Just One Exception :-( Pin
BruceL30-Dec-10 4:47
BruceL30-Dec-10 4:47 
GeneralRe: Just One Exception :-( Pin
azam31631-Dec-10 7:00
azam31631-Dec-10 7:00 
GeneralRe: Re: Just One Exception :-( Pin
azam3161-Jan-11 18:24
azam3161-Jan-11 18:24 
GeneralThanks for sharing Pin
Dr.Walt Fair, PE23-Jun-10 15:48
professionalDr.Walt Fair, PE23-Jun-10 15:48 
GeneralThanks Pin
Apocwhen1-Apr-08 22:58
Apocwhen1-Apr-08 22:58 
Thanks for taking the time to produce the article, however, IMO I think the biggest mistake was to use Crystal Reports to begin. Yes a cutdown version of it comes free with VS2005 but it will cause nothing short of headaches when using it seriously. After 4 months of continuous problems with it I switched all my reports to another product and it's been so much easier to use.

I hope you get on ok with Crystal and don't run into the same problems I once had.
GeneralStupidity Pin
B.Tanner1-Apr-08 7:59
B.Tanner1-Apr-08 7:59 
GeneralA positive experience for me Pin
MightyMart1-Apr-08 7:20
MightyMart1-Apr-08 7:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.