akvo / akvo-reporting

Akvo reporting integration
2 stars 1 forks source link

Import CSV data and setup blank report linking to the data #17

Open zzgvh opened 9 years ago

zzgvh commented 9 years ago

A report designer needs to be able to work in the BIRT designer with a dataset that resembles the live data that's going to be used in production. The same test dataset also needs to be present on the ReportServer when testing the report for publishing.

To enable this workflow we create a script that imports a CSV file and from that sets up the following:

zzgvh commented 9 years ago

Note regarding the generation of table field names

The column headers in the CSVs I have received so far have varied a lot. The import script tries to keep as much as possible of them, while turning them into sane DB field identifiers. Process looks like this:

Some column headers contain whole FLOW questions. They can be so long that they get truncated. Luckily those columns have been prepended with an integer that I guess identifies the question, thus the columns end up being unique even if the text part of them may be the same. Currently the script will abort if there are duplicates in the final DB identifiers.