openui5
openui5 copied to clipboard
sap.ui.export.Spreadsheet: support server-side flattening by only counting hierarchical level
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
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
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
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
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
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
This issue will be covered by backlog item CPOUIFTEAMB-1922.