cancel
Showing results for 
Search instead for 
Did you mean: 

SAP UI5 - TreeTable Export to CSV / XLSX

moritz_zwerger
Explorer
0 Kudos

Hi all,

I'm having trouble setting up the export of a UI5 TreeTable to CSV/Excel.

I'm using the following code:

var oTreeTable = this.getView().byId("TreeTableBasic");	
oTreeTable.exportData({
exportType: new sap.ui.core.util.ExportTypeCSV({separatorChar : ";"}),
    	columns : [{
		name : "test1",
		template : {
			content : "{test1}"
		}
	}]
}).saveFile().catch(function(oError) {
	console.log(oError);
}).then(function() {
	this.destroy();
});

When I open the application and start the download I get the following error:

TypeError: The property "sPath" of an undefined or null reference can not be opened.

There's not even a popup opening to ask for the location to save the file.

I already tried the same code with a standard table which worked fine.

Do you have any ideas how to fix this problem? I don't even know where to find the property "sPath".

Many thanks and best regards

Moritz

Accepted Solutions (0)

Answers (0)