openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

sap.ui.export.Spreadsheet: support server-side flattening by only counting hierarchical level

Open piejanssens opened this issue 4 years ago • 6 comments

The progress and next $skip value is determined on the total amount of records and the records returned by each data received event. Basically sap.ui.export.Spreadsheet currently only supports what you see is what you get; the count you provide needs to count the total records and not just level 0. But that is a problem: it means you need to know the total count of an m:n relationship upfront. In our implementation, this is really not achievable. I only know the count of level '0', but my data source will return multiple levels.

I have currently solved this by extending sap.ui.export.Spreadsheet, sap.ui.export.SpreadsheetExport and sap.ui.export.DataProviderBase to only count elements that have level === '0'.

It would be nice to make this configurable in the standard via a property dataSource.countLimitedToLevel. The implementation of DataProviderBase.prototype.fnOnDataReceive can check for workbook.hierarchyLevel and in that case only count those that match dataSource.countLimitedToLevel:

iFetchedRows = this.mSettings.dataSource && this.mSettings.dataSource && this.mSettings.dataSource.countLimitedToLevel && this.mSettings.workbook && this.mSettings.workbook.hierarchyLevel ? aData.filter((o) => o[this.mSettings.workbook.hierarchyLevel] === this.mSettings.dataSource.countLimitedToLevel).length : aData.length

piejanssens avatar Sep 20 '21 08:09 piejanssens

Hello @piejanssens ,

Thank you for sharing this finding. I've created an internal incident 2170213792. The status of the issue will be updated here in GitHub.

Regards, Patric

pksinsik avatar Sep 21 '21 13:09 pksinsik

Hello piejanssens,

I am the responsible developer for the UI5 client export functionality. I managed to evaluate the technical dependencies of this requirement and could not find any blocking issues that would make this feature impossible for general use. I will forward the requirement to the corresponding product owner.

Please keep in mind that we cannot give any commitment when or if this feature will be available. We will keep you posted.

Regards Sebastian

HerzogIgzorn avatar Nov 02 '21 10:11 HerzogIgzorn

Hello @piejanssens,

I discussed this with Sebastian recently and there are some points which I think I have not fully understood. Your problem is that you can not provide an overall count of all items with the tree, right? Do you know that you can also omit providing a count in the export settings? If I missunderstood it, can you please explain inmore detail what you like to achieve with the setting countLimitedToLevel?

Thanks and Best Regards Jens

simlin avatar Nov 05 '21 13:11 simlin

Hi @simlin,

Yes, I know it is possible to omit providing a count, but that would change UX as there is no longer a progress that can be correctly calculated and visualised.

Best regards,

Pieter

piejanssens avatar Nov 05 '21 13:11 piejanssens

Hello Pieter,

ok, I understand, you ask for an improved (at least approx.) progress indication in cases when a concrete count is not available. This would definitively make sense. I'll transfer the created internal incident into a feature request accordingly.

Thanks and Best Regards Jens

simlin avatar Nov 12 '21 07:11 simlin

This issue will be covered by backlog item CPOUIFTEAMB-1922.

flovogt avatar Mar 04 '22 14:03 flovogt