Grid data export API #7196
Labels
acceptance criteria
used for the acceptance criteria checklist
draft
The acceptance criteria that is still WIP
DS
Design System feature (e.g. component)
Flow
Description
A new Java API for easier export of the Vaadin
Grid
content.Data export is a quite popular use case especially for table-like data components:
Grid
,GridPro
,Crud
,TreeGrid
and various add-on based on them. Vaadin Directory has several solutions.When exporting
Grid
contents, one may need:Grid
content;Grid
customisations, including end user's customisations - selection, styling, sorting and filtering if a report requires other values that are rendered on the web page;All of these information is usually extracted through the different APIs, which is quite a long list:
DataView
,DataProvider
,DataCommunicator
,Renderer
,ValueProvider
,Element
, which makes data export be a challenge for beginner users and even tricky for advanced users, because it requires a good knowledge of the listed classes and sometimes even hacky codes using reflection. Thus, a single facade interface would make sense that hides the complexity and could extract the necessary data for exporting needs.This issue focuses on the way of getting necessary data from
Grid
, whereas the exact data exporting formats and downloading mechanism are out of scope of this. However, the export API should be optimised for most common cases (PDF, CSV, JSON/XML, Excel ?), but make it possible to use it for other formats, see for example Vaadin Grid Exporter add-onUse cases
As a Vaadin application developer
I want an easy way to get the data from Grid through a single API, i.e. a single method or class
So that I can export the data rows, static information and user settings without a preliminary knowledge of Grid internals and various kinds of API.
[1] Use case example: I want to export the
Grid
data in a format that needs only pure data without formatting (e.g. CSV or JSON/XML), I don't need any data conversion nor any customisations, I have no expertise nor I want to dig intoRender
orDataProvider
specifics, just print what I see on my web page as a plain text array.[2] Advanced use case: I want to export with the actual renderings and formatting (or with some partial formatting), e.g. to the PDF or styled Excel format. Also I may want a restricted version of my
Grid
, i.e. less columns and only selected rows, with keeping as much styles as possible and filling custom rendered columns with component images, so they look same beauty as on the web page.[3] Clone case: I want to clone my
Grid
entirely or partially, e.g. if I want to have originalGrid
on the left and same styledGrid
, but with no data, to which I can drag and drop items from the original grid.Acceptance criteria
Button
->getText()
,Icon
->getAttribute("icon")
,CheckBox
->"Yes"/"No"
, and additionally the API provides a callback that takes an item or component and returns an extracted plain text, then the report maker can extract a plain text from it and style it in it's own way, or use some html-to-image tools , e.g. this or that.Grid
, including data and settings parts.API example
General criteria
Security
The text was updated successfully, but these errors were encountered: