Friday, April 21, 2006

Crystal Reports Strikes Again

Ok...

Besides the fact that Crystal Reports saves the development data WITH the report definition, I have stumbled with another weirdness of it.

Like almost everyone else we use two databases: one for development and one for production.

Because my boss here wanted to develop with a database server as similar as possible to the production server, he put the developement database on the same server where the production is. More similar than this I think it's impossible ;-)

Anyway... I completed the report design tested all the quirks and stuff, and it was ready to production.

When I put the report in production... BANG! There was the development data.

DAMN! I knew I did everything right, checked all the code, every single byte and nothing was wrong... Until I checked the damn Crystal Reports Definition File.

And there it was, hidden in plain sight: DevelopmentDatabase.dbo.TableName.

Yep! You guessed it right. In my case it doesn't matter if I change the ConnectionInfo to set the ProductionDatabase. Because the development and production database are in the same server, the SQL Server will always read from the development database.

WTF?!

Why?! Again, WHY?!

Let's thinkg for a moment, shall we?

We're creating a report engine tool that will be used with several different databases, with several different table names.

Developers tend to have two different environments: Development and Production.

We need to store the name of the table from where we will collect the data to print in the report.

How do we do this?

I don't know about people at BusinessObjects but I'd store only the table name, because development and production usually are VERY different from each other.

To make a long story short:

AFTER you change the ConnectionInfo property for each and every table in the Crystal Report Document, you need to set the Location of each table.

0 Comments:

Post a Comment