Class ReportSpreadsheetView

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<ViewLayout>
io.jmix.flowui.view.View<ViewLayout>
io.jmix.flowui.view.StandardView
io.jmix.reportsspreadsheetflowui.view.ReportSpreadsheetView
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasStyle, com.vaadin.flow.router.AfterNavigationObserver, com.vaadin.flow.router.BeforeEnterObserver, com.vaadin.flow.router.BeforeLeaveObserver, com.vaadin.flow.router.HasDynamicTitle, com.vaadin.flow.router.internal.AfterNavigationHandler, com.vaadin.flow.router.internal.BeforeEnterHandler, com.vaadin.flow.router.internal.BeforeLeaveHandler, FacetOwner, FragmentOwner, Serializable

@Route(value="report/spreadsheets", layout=DefaultMainViewParent.class) @ViewController("report_ReportSpreadsheetView") @ViewDescriptor("report-spreadsheet-view.xml") @DialogMode(width="80em", height="65em", resizable=true) public class ReportSpreadsheetView extends StandardView
View that renders a generated spreadsheet report and allows downloading the current workbook state. Can be opened either as a dialog or via navigation to its route.
See Also:
  • Field Details

  • Constructor Details

    • ReportSpreadsheetView

      public ReportSpreadsheetView()
  • Method Details

    • setDocumentContent

      public void setDocumentContent(byte[] documentContent)
      Sets generated report content to be opened by this view.
    • setDocumentName

      public void setDocumentName(@Nullable String documentName)
      Sets the report document name shown by the view and used for download.
    • setFileRef

      public void setFileRef(FileRef fileRef)
      Sets a stored report document reference to be opened by this view.
    • getPageTitle

      public String getPageTitle()
      Specified by:
      getPageTitle in interface com.vaadin.flow.router.HasDynamicTitle
      Overrides:
      getPageTitle in class View<ViewLayout>
    • onReady

      @Subscribe protected void onReady(View.ReadyEvent event)
    • loadContent

      public void loadContent()
      Reads the configured spreadsheet content into the Spreadsheet component. Idempotent: subsequent invocations (e.g. on a repeated lifecycle event) are no-ops, and the method does nothing until setDocumentContent(byte[]) or setFileRef(FileRef) has been called. For the NAVIGATION open mode, where data is set after the regular lifecycle events, this method must be invoked explicitly from withAfterNavigationHandler.
    • onOpenInViewBtnClick

      @Subscribe("openInViewBtn") protected void onOpenInViewBtnClick(com.vaadin.flow.component.ClickEvent<JmixButton> event)
    • getCurrentContent

      protected byte[] getCurrentContent()
      Returns the current content of the Spreadsheet component, including unsaved user edits, to be handed over to another instance of this view. Returns null if no content has been loaded yet or the current workbook cannot be written, so the caller falls back to the originally provided content.
    • closeOtherDialogs

      protected void closeOtherDialogs(@Nullable com.vaadin.flow.component.UI ui)
      Closes any other dialog views that remained open (e.g. the input parameters dialog stacked behind this view), so that the navigation target is shown without leftover modal layers.
    • onDownloadBtnClick

      @Subscribe("downloadBtn") protected void onDownloadBtnClick(com.vaadin.flow.component.ClickEvent<JmixButton> event)
    • onCloseBtnClick

      @Subscribe("closeBtn") protected void onCloseBtnClick(com.vaadin.flow.component.ClickEvent<JmixButton> event)
    • openInputStream

      protected InputStream openInputStream() throws IOException
      Throws:
      IOException
    • resolveWorkbookExtension

      protected String resolveWorkbookExtension()
    • buildDownloadFileName

      protected String buildDownloadFileName(String extension)