I would like to export all the database objects used within a report (.trdp file), and the number of times each reference is used. The rationale is we need to be able to easily identify all the database objects (e.g., tables and columns) used in a report whenever schema change discussions arise. This would include columns used in text elements, tables, charts, expressions, and so on.
Example:
REPORT | DATASOURCE | TABLENAME | FIELD | NUM_REFERENCES |
FacilitiesReport.trdp | facilities | facility | id | 1 |
FacilitiesReport.trdp | facilities | facility | name | 2 |
FacilitiesReport.trdp | facilities | facility | zip_code | 1 |
FacilitiesReport.trdp | facilities | city | zip | 1 |
FacilitiesReport.trdp | facilities | city | name | 3 |
FacilitiesReport.trdp | facilities | city | state | 1 |
I doubt this exists out of the box so I figure I need to script something. I am considering creating an instance of a report and looping through all the objects and collecting all datasource and field references in a dictionary and then exporting the completed dictionary to a csv.
I could also unzip the trdp file and parse the xml, but if the schema changes from version to version I could wind up with brittle or broken code.
Has anyone here down something similar? Recommendations?