openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

Feature Request: Make UI5 controls more print-friendly

Open pubmikeb opened this issue 6 years ago • 11 comments

SAPUI5/OpenUI5 version: 1.70

Browser/version (+device/version): Chrome, Firefox

Let say, I have a long table with items, e.g.: https://openui5nightly.hana.ondemand.com/test-resources/sap/m/demokit/tutorial/worklist/07/webapp/test/mockServer.html, and I would like to get/print a PDF-report with items of this table.

Like most of the enterprise reports, such PDF should contain:

  • header with the corporate logo, report title, brief description, and contact info
  • a table itself with data, supporting paginations
  • footer with some legal notice

Currently, I can either print the whole page «as is» with a lot of irrelevant data (e.g., UI controllers) or try to customize the report by using standard HTML/browser approaches like document.body.innerHTML and window.print(), but these techniques don't solve the pagination issue and aren't so fast/easy-to-implement.

It would be great if UI5 data-containers (e.g. sap.m.List and sap.m.Table) will be more print-friendly by having special built-in print-friendly CSS-mode. Is it possible to implement some print-wrapper for data containers to bring printing functionality out-of-box?

pubmikeb avatar Aug 10 '19 08:08 pubmikeb

There are dedicated products for reporting purposes, where rendering and CSS are adjusted for the purpose of having print from browser or properly generated PDF, DOCX etc format. In this case, there is a sap.m.ListBase control which may include growing functionality based on "More" button, unknown amount of columns, for Tree and grouped controls, means hidden groups of rows and columns.

If the purpose of the print is to get data, you can:

  • load this data in a reporting tool (this will let you print, produce PDF, DOCX, XLSX, etc files)
  • use the Spreadsheet option to generate Excel with the data
  • use the app to transfer data to everyone authorized to access the app

Let me know if I am missing the idea of the request. Possibly are you asking for PDF export of data?

stephania87 avatar Sep 01 '19 14:09 stephania87

In my perception export data to PDF format and ability to design PDF/XLSX reports with page header and footer, page counter, etc... is a basic request. All OPENUI developers would love to have simple report control.

imargulyan avatar Sep 01 '19 15:09 imargulyan

@stephania87, regarding "Possibly are you asking for PDF export of data?", it would be great to have an ability to export data to PDF out-of-box from any data container UI-element.

pubmikeb avatar Sep 01 '19 15:09 pubmikeb

Forwarding to dev team (tables only) for evaluation #1980361802 Note that the team is responsible only for the table controls and there is already existing Excel export of the data bound to a table

stephania87 avatar Sep 02 '19 15:09 stephania87

there is already existing Excel export of the data bound to a table

As far as I know, OpenUI5 contains only export to CSV via sap.ui.core.util.ExportTypeCSV, the export to real Excel file (XLSX, Office Open XML Spreadsheet format) is provided by sap.ui.export.Spreadsheet, which is available exclusively in SAPUI5. That's why I opened https://github.com/SAP/openui5/issues/2635 aswell.

Update: As of 1.73, sap.ui.core.util.ExportTypeCSV is deprecated, which means, that currently UI5 doesn't offer any single official stable way to export a content of a table to CSV/Excel.

pubmikeb avatar Sep 02 '19 16:09 pubmikeb

This issue will be covered in BLI FIORITECHP1-13991 and BLI FIORITECHP1-13992.

flovogt avatar Mar 01 '22 08:03 flovogt

@flovogt, is there any any update on the issue?

pubmikeb avatar May 07 '24 15:05 pubmikeb

@simlin any updates here?

flovogt avatar May 13 '24 13:05 flovogt

Well, moving the sap.ui.export library or at least the Excel parts of it to OpenUI5 is still on our roadmap, but unfortunately with a low priority.

simlin avatar May 15 '24 13:05 simlin