Skip to content

feat: Exclude zeros and missing values PXWEB-1016#186

Merged
likp merged 24 commits intomainfrom
feature/exclude-zeros
Apr 24, 2026
Merged

feat: Exclude zeros and missing values PXWEB-1016#186
likp merged 24 commits intomainfrom
feature/exclude-zeros

Conversation

@likp
Copy link
Copy Markdown
Contributor

@likp likp commented Feb 20, 2026

Add option to exclude zeros and missing values called ExcludeZerosAndMissingValues in the following file formats

  • Csv
  • Excel
  • Html
    Default value is false setting it to true will not write row that are just zero or a missing value.

likp added 18 commits February 20, 2026 09:40
Introduced ExcludeZerosAndMissingValues property to CsvSerializer. When enabled, rows (or the single heading row) containing only zero or missing values are omitted from the CSV output by checking with df.IsZeroRow. This helps produce cleaner exports by removing irrelevant data rows.
Previously, ZeroOption was always set to NoZeroNilAndSymbol in the DataFormatter. Now, it is only set when ExcludeZerosAndMissingValues is true, allowing for more flexible handling of zero and missing values in CSV serialization.
Added caching to efficiently detect and skip empty rows when serializing PXModel tables to HTML. Introduced StubX and AreAllEmptyRows methods for row grouping and emptiness checks. Changed ExcludeZerosAndMissingValues default to true, so empty rows are excluded by default. Improves performance and output clarity.
Renamed the StubX method to CalculateStubRepeat for clarity and converted it to a static method. Updated all references to use the new method name, improving code readability and organization.
Introduced ExcludeZerosAndMissingValues property to CsvSerializer. When enabled, rows (or the single heading row) containing only zero or missing values are omitted from the CSV output by checking with df.IsZeroRow. This helps produce cleaner exports by removing irrelevant data rows.
Previously, ZeroOption was always set to NoZeroNilAndSymbol in the DataFormatter. Now, it is only set when ExcludeZerosAndMissingValues is true, allowing for more flexible handling of zero and missing values in CSV serialization.
Added caching to efficiently detect and skip empty rows when serializing PXModel tables to HTML. Introduced StubX and AreAllEmptyRows methods for row grouping and emptiness checks. Changed ExcludeZerosAndMissingValues default to true, so empty rows are excluded by default. Improves performance and output clarity.
Renamed the StubX method to CalculateStubRepeat for clarity and converted it to a static method. Updated all references to use the new method name, improving code readability and organization.
Introduced ExcludeZerosAndMissingValues and ValueLablesDisplay properties to the serializer. When enabled, rows containing only zeros or missing values are omitted from the exported XLSX. Refactored stub heading writing to support this feature using a new recursive WriteStubHeading method. Updated data row writing logic to skip excluded rows. Removed legacy stub heading code in favor of the new approach.
@PxTools PxTools deleted a comment from sonarqubecloud Bot Apr 23, 2026
likp added 6 commits April 23, 2026 07:39
The line 'return sc;' was removed, indicating a change in the method's return behavior or type. No replacement code was added, simplifying the method's logic.
Refactored WriteTableWithnHeadingVariables and WriteTableWithSubVariables to remove value and df parameters. These methods now instantiate their own local variables, resulting in cleaner interfaces and improved encapsulation. Updated WriteTable to use the new method signatures.
@sonarqubecloud
Copy link
Copy Markdown

@likp likp changed the title feat: Exclude zeros and missing values feat: Exclude zeros and missing values PXWEB-1016 Apr 23, 2026
@likp likp marked this pull request as ready for review April 23, 2026 06:29
Copy link
Copy Markdown
Member

@runejo runejo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@likp likp merged commit f2158de into main Apr 24, 2026
10 checks passed
@likp likp deleted the feature/exclude-zeros branch April 24, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants