Class SpreadsheetReportExecutionPresentation
java.lang.Object
io.jmix.reportsspreadsheetflowui.runner.SpreadsheetReportExecutionPresentation
- All Implemented Interfaces:
ReportExecutionPresentation
@Component("repspd_SpreadsheetReportExecutionPresentation")
public class SpreadsheetReportExecutionPresentation
extends Object
implements ReportExecutionPresentation
ReportExecutionPresentation that targets the embedded spreadsheet viewer.
Limits template and output-type choices to XLS/XLSX combinations that the spreadsheet viewer can render.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAvailableOutputTypes(@Nullable Report report, @Nullable ReportTemplate template) getAvailableTemplates(@Nullable Report report) getId()booleanrequiresUserChoice(@Nullable Report report, @Nullable ReportTemplate selectedTemplate, @Nullable ReportOutputType selectedOutputType) A selection passed in the arguments does not automatically remove the need to ask: the built-in presentations still let the user choose between several compatible templates, but do not ask for an output type that has already been chosen.@Nullable ReportOutputTyperesolveDefaultOutputType(@Nullable Report report, @Nullable ReportTemplate template, @Nullable ReportOutputType selectedOutputType) Resolves the output type to run the report with.@Nullable ReportTemplateresolveDefaultTemplate(@Nullable Report report, @Nullable ReportTemplate selectedTemplate) protected booleansupportsOutputType(@Nullable ReportOutputType outputType) booleansupportsReport(@Nullable Report report) protected booleansupportsTemplate(@Nullable ReportTemplate template)
-
Constructor Details
-
SpreadsheetReportExecutionPresentation
public SpreadsheetReportExecutionPresentation()
-
-
Method Details
-
getId
- Specified by:
getIdin interfaceReportExecutionPresentation- Returns:
ReportExecutionPresentationIds.SPREADSHEET
-
supportsReport
- Specified by:
supportsReportin interfaceReportExecutionPresentation- Returns:
trueif the report has at least one template that can be opened in the spreadsheet viewer
-
getAvailableTemplates
- Specified by:
getAvailableTemplatesin interfaceReportExecutionPresentation- Returns:
- templates of the report that produce spreadsheet-compatible output
-
resolveDefaultTemplate
public @Nullable ReportTemplate resolveDefaultTemplate(@Nullable Report report, @Nullable ReportTemplate selectedTemplate) - Specified by:
resolveDefaultTemplatein interfaceReportExecutionPresentation- Returns:
- the template to use by default when opening in the spreadsheet viewer,
preferring
selectedTemplateif it is spreadsheet-compatible
-
getAvailableOutputTypes
public List<ReportOutputType> getAvailableOutputTypes(@Nullable Report report, @Nullable ReportTemplate template) - Specified by:
getAvailableOutputTypesin interfaceReportExecutionPresentation- Returns:
- output types for the template that are renderable in the spreadsheet viewer, or an empty list when the template does not support alterable output
-
resolveDefaultOutputType
public @Nullable ReportOutputType resolveDefaultOutputType(@Nullable Report report, @Nullable ReportTemplate template, @Nullable ReportOutputType selectedOutputType) Description copied from interface:ReportExecutionPresentationResolves the output type to run the report with.An explicitly requested
selectedOutputType, e.g. the one set through the report runner API, must not be silently replaced: an implementation may return another type only if the requested one cannot be produced, either because this presentation is unable to render it or because the template cannot be converted to it. Restrictions on what the user is allowed to choose belong toReportExecutionPresentation.getAvailableOutputTypes(Report, ReportTemplate)instead.- Specified by:
resolveDefaultOutputTypein interfaceReportExecutionPresentation- Returns:
- the output type to use by default when opening in the spreadsheet viewer,
preferring
selectedOutputTypeif it is spreadsheet-compatible
-
requiresUserChoice
public boolean requiresUserChoice(@Nullable Report report, @Nullable ReportTemplate selectedTemplate, @Nullable ReportOutputType selectedOutputType) Description copied from interface:ReportExecutionPresentationA selection passed in the arguments does not automatically remove the need to ask: the built-in presentations still let the user choose between several compatible templates, but do not ask for an output type that has already been chosen.- Specified by:
requiresUserChoicein interfaceReportExecutionPresentation- Returns:
trueif the user must choose a template or output type before the report can be opened in the spreadsheet viewer. Returnstruewhenever multiple spreadsheet-compatible templates exist (even if a default was pre-filled by the runner) or when the single template offers more than one compatible output type and none has been explicitly chosen.
-
supportsTemplate
-
supportsOutputType
-