Skip to content

Export to Excel: include non-empty selection criteria #2661

@jhou-pro

Description

@jhou-pro

Description

Visibility of criteria values that correspond to the exported result set is required. Somewhat related issue #2112 addresses a similar aspect of Entity Centres — to display only the selection criteria with values or mnemonics, hiding unused ones to reduce the visual clutter.

Data exported to Excel currently provides no indication of which criteria were used during export. The exporting functionality should therefore be enhanced to optionally include non-empty criteria titles and values above the exported data rows.


1. Export Dialog — New Checkbox

Add a new checkbox to the Export dialog labelled Include selection criteria?. The checkbox must default to unchecked (opt-in behaviour). When unchecked, the export output is unchanged from its current form.

  • New Include selection criteria? checkbox added to the Export dialog
  • Checkbox defaults to unchecked
  • Export output is unchanged when checkbox is unchecked

2. Criteria Block Placement & Structure

When the checkbox is selected, criteria are written to the same sheet as the exported data, above the data rows, followed by a single blank separator row before the column headers begin.

Each non-empty criterion occupies one row, consisting of exactly two cells:

Column A Column B
Property Title: (bold) String representation of the value

Column A contains the property title suffixed with a colon, rendered in bold. Column B contains the value as plain text. Both cells are written starting at column A, regardless of any column offset used by the data grid.

If all criteria are empty and the checkbox is ticked, the criteria block and separator row are silently omitted — the output is identical to an unchecked export.

  • Criteria block is written above the data rows on the same sheet
  • A single blank row separates the criteria block from the data column headers
  • Each criterion occupies one row: bold Property Title: in column A, value in column B
  • Both cells start at column A regardless of the data grid's column offset
  • If all criteria are empty, the criteria block and separator row are silently omitted

3. Value String Representations

Range (from/to) criteria

Use square brackets for included boundaries and round brackets for excluded boundaries, matching the standard interval notation controlled by mnemonics. Represent an empty from or to bound as a single space character " ".

Money values must omit the currency symbol. Numbers and dates must be formatted using EntityUtils.toString.

Examples:

  • (1,000.00, 10,000.00]
  • [ , 21/10/2027]
  • (500, ]

Boolean criteria

Boolean criteria must only be included if exactly one of Yes or No is specified. When both options are ticked or both are unticked the criterion has no effect on data selection and must be omitted (see DynamicQueryBuilder.isEmptyWithoutMnemonics). The value cell must contain either Yes or No.

Boolean criteria are not subject to the Or Missing Value or Negated flags (see Item 4). This flags can't be selected from selection criteria UI.

Multi-value criteria (e.g. autocomplete entity lists)

All selected values must be rendered comma-separated in a single value cell.

Example: Alice,Bob*,Carol

Mnemonic-driven criteria

Mnemonics must not be represented literally. Instead, always show the computed number and date values that were used to run the export query. Refer to DynamicQueryBuilder.getDateValuesFrom to see how this is done for date mnemonics.

  • Range boundaries use [/] for inclusive and (/) for exclusive.
  • Empty range bounds are rendered as a single space character (this is only possible with [or missing]).
  • Money values omit the currency symbol (only the numeric part is used for selection criteria).
  • Numbers and dates are formatted via EntityUtils.toString.
  • Boolean criteria are omitted when both or neither of Yes/No are selected (see DynamicQueryBuilder.isEmptyWithoutMnemonics).
  • Boolean values are always rendered as Yes or No.
  • Multi-value criteria are comma-separated in a single value cell.
  • Mnemonic-driven date criteria display computed values from DynamicQueryBuilder.getDateValuesFrom, not the mnemonic label.

4. "Or Missing Value" and "Negated" Flags

Where a criterion has Or Missing Value or Negated set, these flags must be placed as text after the value cell (Column B) into next cell (Column C), using the following exact flags:

  • [or missing] — for Or Missing Value
  • [negated] — for Negated

When both flags are active, both tokens appear in the same Column C cell, separated by a space, always in the order [or missing] then [negated]. When neither flag is active, Column C is omitted entirely.

The row structure is therefore:

Column A Column B Column C
Property Title: (bold) String representation of the value [or missing] and/or [negated] (only if active)

Examples:

  • (1,000.00, 10,000.00][or missing]

  • Alice, Bob[negated]

  • (500, ][or missing] [negated]

  • Active flags are written in a separate Column C cell.

  • [or missing] is written in Column C when Or Missing Value is active.

  • [negated] is written in Column C when Negated is active.

  • When both are active, Column C contains [or missing] [negated].

  • Column C is omitted entirely when no flags are active.

5. Criteria Ordering

List all non-empty criteria in the order they are added to the Entity Centre configuration.

Change Overview

Expected Outcome

The resulting Excel spreadsheet clearly displays the selection criteria used to export the data, improving transparency and traceability. Criteria appear above the data on the same sheet, in layout order, with bold titles and human-readable values — including boundary notation, flags, and computed date values in place of mnemonics.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions