Legacy Reports

By Ryan

Anyone out there still suffering with Crystal Reports 8 or 8.5?  Anyone still using the ocx to generate a report for a client?  What?  I’m the only one.  Damn.  Well, I’ve finally gotten sick of some of the limitations of using an ocx to access reports through an ODBC connection with static DB links inside the report files.  So any time they move, we get to open up every single one and change the location of them.  No longer I say!

With a bunch of digging through files so old no one should need to remember them, I found the solution to migrating away from the ocx/odbc solution and instead accessing the report application class and doing run-time setting of the database links for each report file.  Here are the tricky steps I had to take to make this work.

First I had to change the code to reference the Report Designer Component instead of the Crystal ocx.  Only a decade after this upgrade first happened in the offices of Seagate I might add.  This is explained in the Crystal Reports 8 Developer’s Guide which you may find as a pdf if you look for it.  Then, after digging around in a couple of troubleshooting articles on Business Object’s website, I got the feeling that this version of Crystal didn’t play too well with the native MS SQL driver.  This was one of the two sticking points for me, as I kept trying to use it and kept getting errors when setting the location of the reports in the code.  I switched my test report to using an OLE DB connection and that helped me open connections after setting the location at run time.  The other sticking point was that the Location field of the reports had been populated with a “database”.”owner”.”table” syntax, which works fine, but will prevent you from modifying the location at run time.  If you just remove the database and owner parts of that in the Set Location dialog within the report, you’ll be able to make the changes and connect to your database at run time with no problem.

Leave a Reply