Class GridExporter<T>

  • All Implemented Interfaces:
    java.io.Serializable

    public class GridExporter<T>
    extends java.lang.Object
    implements java.io.Serializable
    See Also:
    Serialized Form
    • Field Detail

      • totalcells

        public int totalcells
    • Method Detail

      • createFor

        public static <T> GridExporter<T> createFor​(com.vaadin.flow.component.grid.Grid<T> grid)
      • createFor

        public static <T> GridExporter<T> createFor​(com.vaadin.flow.component.grid.Grid<T> grid,
                                                    java.lang.String excelCustomTemplate,
                                                    java.lang.String docxCustomTemplate)
      • setButtonsAlignment

        public void setButtonsAlignment​(ButtonsAlignment buttonsAlignment)
      • getDocxStreamResource

        public com.vaadin.flow.server.StreamResource getDocxStreamResource()
      • getDocxStreamResource

        public com.vaadin.flow.server.StreamResource getDocxStreamResource​(java.lang.String template)
      • getPdfStreamResource

        public com.vaadin.flow.server.StreamResource getPdfStreamResource()
      • getPdfStreamResource

        public com.vaadin.flow.server.StreamResource getPdfStreamResource​(java.lang.String template)
      • getCsvStreamResource

        public com.vaadin.flow.server.StreamResource getCsvStreamResource()
      • getExcelStreamResource

        public com.vaadin.flow.server.StreamResource getExcelStreamResource()
      • getExcelStreamResource

        public com.vaadin.flow.server.StreamResource getExcelStreamResource​(java.lang.String template)
      • getTitle

        public java.lang.String getTitle()
      • setTitle

        public void setTitle​(java.lang.String title)
        Sets the title of the exported file
        Parameters:
        title -
      • getFileName

        public java.lang.String getFileName()
      • setFileName

        public void setFileName​(java.lang.String fileName)
        Sets the filename of the exported file
        Parameters:
        fileName -
      • isAutoAttachExportButtons

        public boolean isAutoAttachExportButtons()
      • setAutoAttachExportButtons

        public void setAutoAttachExportButtons​(boolean autoAttachExportButtons)
        If true, it will automatically generate export buttons in the asociated grid
        Parameters:
        autoAttachExportButtons -
      • getAdditionalPlaceHolders

        public java.util.Map<java.lang.String,​java.lang.String> getAdditionalPlaceHolders()
      • setAdditionalPlaceHolders

        public void setAdditionalPlaceHolders​(java.util.Map<java.lang.String,​java.lang.String> additionalPlaceHolders)
        Sets a map that will contain additional place holders that will be replaced with values when processing the exported file
        Parameters:
        additionalPlaceHolders -
      • getSheetNumber

        public int getSheetNumber()
      • setSheetNumber

        public void setSheetNumber​(int sheetNumber)
        Configures the excel sheet that will be inspected for placeholders to export the data
        Parameters:
        sheetNumber -
      • isAutoMergeTitle

        public boolean isAutoMergeTitle()
      • setAutoMergeTitle

        public void setAutoMergeTitle​(boolean autoMergeTitle)
        If true the title cell will be merged with the next ones to create a single title cell that will span across the columns
        Parameters:
        autoMergeTitle -
      • isExcelExportEnabled

        public boolean isExcelExportEnabled()
      • setExcelExportEnabled

        public void setExcelExportEnabled​(boolean excelExportEnabled)
      • isDocxExportEnabled

        public boolean isDocxExportEnabled()
      • setDocxExportEnabled

        public void setDocxExportEnabled​(boolean docxExportEnabled)
      • isPdfExportEnabled

        public boolean isPdfExportEnabled()
      • setPdfExportEnabled

        public void setPdfExportEnabled​(boolean pdfExportEnabled)
      • isCsvExportEnabled

        public boolean isCsvExportEnabled()
      • setCsvExportEnabled

        public void setCsvExportEnabled​(boolean csvExportEnabled)
      • isAutoSizeColumns

        public boolean isAutoSizeColumns()
      • setAutoSizeColumns

        public void setAutoSizeColumns​(boolean autoSizeColumns)
      • setExportValue

        public void setExportValue​(com.vaadin.flow.component.grid.Grid.Column<T> column,
                                   com.vaadin.flow.function.ValueProvider<T,​java.lang.String> vp)
        Configure a value provider for a given column. If there is a value provider, that will be taken into account when exporting the column
        Parameters:
        column -
        vp -
      • setExportColumn

        public void setExportColumn​(com.vaadin.flow.component.grid.Grid.Column<T> column,
                                    boolean export)
        Configure if the column is exported or not
        Parameters:
        column -
        export - : true will be included in the exported file, false will not be included
      • setNullValueHandler

        public void setNullValueHandler​(com.vaadin.flow.function.SerializableSupplier<java.lang.String> nullValueSupplier)