views:

229

answers:

3

If you have two versions of the same report (.rpt) and you want to establish what the exact differences are, what is the best way to go about this? I've seen some commercial tools to do this, but I'm not too interested in forking out cash for something that should be relatively straight forward. Can I hook into the Crystal API and simply list all of the properties of every field or something? Please someone tell me that there's an Open Source project somewhere that does this... @:-)

@Kogus, wouldn't diffing the outputs as text hide any formatting differences?

@ladoucep, I don't seem to be able to export the report without data.

A: 

One helpful technique is to output both versions of the report to plain text, then diff those outputs.

You could write something using the crystal report component to describe every property of the report, like you described. Then you could output that to text, and diff those. I'm not aware of any open source tool that does it for you, but it would not be terribly hard to write it.

@question in the post: Diffing the outputs would only show formatting changes if the relative positions had changed. For example, if i had this:

before: First name, last name, addresss

after: Last Name, First Name, Address

Then that would show up as a difference.

But if I had just bumped the address column over a few pixels, or changed it from plain text to bold, then you are right, that would not show up.

JosephStyons
+1  A: 

One technique I have used to great effect in the past is to print out reports from both versions based on the same data. I then take the first page from each version, lay one on top of the other (it is important not to mix them up) and hold them up to a window. It is generally quite easy to see any differences, and these differences can be manually annotated with a suitable writing instrument such as a pencil. Repeat for each page in the report.

Admittedly, for large reports this can be quite time consuming and error prone, but these limitataions can be overcome with patience and care.

Kramii
ha, nice - the low tech (or no tech) ways are often the best!
ninesided
+2  A: 

Can I hook into the Crystal API and simply list all of the properties of every field or something? Please someone tell me that there's an Open Source project somewhere that does this... @:-)

There is in fact, such an API. I wrote a VB6 application to do just what you asked and more. I think I even migrated it to VB.Net. As it was for my own use, I didn't spend much time making it 'polished'. I've been intending to release it, but I haven't had the time...

Another approach that I've used in the past is to create an Access application to help manage large, report-development projects. One of it's many features includes the ability to extract the tables that are used by the report, and the SQL statements used by its Commands and SQL Expressions. It's intent is to give one a global perspective of which reports use which tables. I probably still have it somewhere...

Craig
If you think your code would support Crystal Reports 11, I would be interested in obtaining access to both of the programs you describe.
LeBleu
this does sound pretty handy, is it something you'd be happy to put up in a GitHub repository or something?
ninesided
Added to code.google.com. Project name is 'RptToXml'.
Craig