Home
Analytics
BIRT Web Viewer - controlling column order in data export to CSV
keith6868
I am developing a report using open source BIRT version 2.3.2 (for eventual with Maximo 7.1.1.5 and, hence, using a scripted data source).
The users wish to use the report to export data to Excel via CSV on a monthly basis.
My problem is that they are very fussy about the order of the columns in the CSV and do not want to have to juggle these in the 'Data Export' dialogue box of the BIRT web viewer every time they run the report: they simply want to be able to use the '>>' icon to move the data items en bloc from the 'Available Columns' without reordering them.
The order of the data items in the 'Available Columns' list seems to be determined by the order in which they appear in the list under the 'Data Column binding' list of the 'Binding' tab of 'Property Editor - Table' so the obvious answer would seem to be to make this list agree with the order in which the users want the data items to be displayed in 'Data Export'.
However, there appears to be no way of altering the order of the bindings short of deleting them all and starting from scratch as the order seems to derive from the order in which they were created during development. I am not included to take this approach as it is more than possible that the users will ask for changes in the future.
Does anyone know if there is any way round my problem of controlling the column order of a data export? Ideally, I would like it to be the same as the report itself.
Find more posts tagged with
Comments
mwilliams
You might be able to grab the source of the CSV emitter and modify it to meet your needs. I don't know how hard this will be, but I'm guessing it's possible.
keith6868
Well, that sounds a bit beyond me but I have found a workaround: if I edit the XML of the .rptdesign, I can reorder the <em class='bbc'><structure>...</structure></em> tags of the <em class='bbc'><list-property name="boundDataColumns"></em> tag of the table in question, which action reorders the column bindings, with the result that they appear in the desired order in the 'data export' dialogue box: fiddly but possible nevertheless.
mwilliams
So, the export is in the order that they appear in your dataSet. So, you should be able to order them how you're wanting in your table by writing your query in such a way that they are brought into BIRT in the correct order.