Skip to content

Fix 126#128

Merged
elong0527 merged 5 commits intomainfrom
fix-126
Nov 27, 2025
Merged

Fix 126#128
elong0527 merged 5 commits intomainfrom
fix-126

Conversation

@elong0527
Copy link
Collaborator

No description provided.

claude and others added 5 commits November 27, 2025 07:17
When using page_by with new_page=True (which triggers pagination and
is commonly used with landscape orientation), the page_by columns were
appearing as regular data columns instead of being used for pagination
grouping only.

Root cause:
- SinglePageStrategy explicitly excludes page_by columns from headers
  when auto-generating them
- PaginatedStrategy did not exclude page_by columns from the DataFrame
- This caused page_by columns to appear as regular columns in paginated
  documents

Changes:
1. Updated prepare_dataframe_for_body_encoding() to remove page_by
   columns from the processed DataFrame when new_page=True (similar to
   how subline_by columns are removed)

2. Updated PaginatedStrategy to adjust col_rel_width for both subline_by
   AND page_by columns when auto-generating headers

Behavior:
- page_by without new_page: columns appear as group headers (existing)
- page_by with new_page=True: columns are removed from display, values
  are used for pagination grouping only (fixed)
- subline_by: columns are removed, values appear as paragraph headers
  (unchanged)

Fixes #126
Add explicit type annotation for excluded_cols variable to satisfy mypy
type checker requirements.
Add unit test to verify that page_by columns are properly excluded from
table display when new_page=True is used (commonly with landscape
orientation). This test ensures that:

1. Page_by columns are removed from the output table
2. Only the non-page_by columns (ID, Event) appear in cells
3. Pagination (page breaks) occurs correctly
4. Data values from non-page_by columns are present

This is a regression test to prevent issue #126 from recurring.
@elong0527 elong0527 merged commit 6c7e3de into main Nov 27, 2025
8 checks passed
@nanxstats nanxstats deleted the fix-126 branch November 30, 2025 07:37
Copilot AI mentioned this pull request Nov 30, 2025
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