cancel
Showing results for 
Search instead for 
Did you mean: 

Downloading excel with Merged cells in sapui5

sesettijaswanth
Explorer
0 Kudos
571

hello everyone,

I'm currently working on a requirement related to downloading Excel data from the sap.ui.table. Specifically, if the TrainId is the same for all the CarId. I've managed to download the table data using the sap.ui.export.Spreadsheet API reference in sap sdk. however, the requirement demands that cells should merge during the downloading process, based on Trainid. in the case where the trainId is identical(same) for all the CarIds, the trainId cell should merge.

API reference

https://sapui5.hana.ondemand.com/#/entity/sap.ui.export.Spreadsheet/sample/sap.ui.export.sample.tabl...

Expectation output

if anyone who worked on this requirement please let's know your solution to this issue

Accepted Solutions (1)

Accepted Solutions (1)

Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert

Hi sesetti_jaswanth,

As far as I know the API you used doesn't export the file in pure Excel format. Instead, it exports it in CSV format. So, cell merging is not something you can define on a CSV as it is a simple flat text file with comma separated fields and rows.

You could use a more robust JavaScript library to export the contents of an OData service that would generate the expected results by manipulating each row based on its contents. However, this would imply you would rely on column sorting at the OData, so you would be able to detect for column content changes.

Best regards,
Ivan

sesettijaswanth
Explorer
0 Kudos

Hi Ivan,

Thanks for your advice. we managed to enable "warp text," but merging cells hasn't worked out with that API. Do you think it's possible to achieve both requirements simultaneously?

Best regards,

Jaswanth sesetti

Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert

Hi sesetti_jaswanth,

Please forgive me for the wrong information I shared here. The export function is not going to generate a CSV flat file. It instead creates an XML file according to the Open Office XML file format.

However, there seems to be no export configuration to perform a merge cell operation like you want to achieve.

https://ui5.sap.com/#/topic/7e12e6b9154a4607be9d6072c72d609c

Best regards,
Ivan

Answers (0)