Skip to content

Improve Excel preflight and report evidence#1979

Open
PrzemyslawKlys wants to merge 7 commits into
masterfrom
codex/excel-market-improvements
Open

Improve Excel preflight and report evidence#1979
PrzemyslawKlys wants to merge 7 commits into
masterfrom
codex/excel-market-improvements

Conversation

@PrzemyslawKlys

Copy link
Copy Markdown
Member

Summary

  • add workflow-level Excel preflight capabilities with diagnostics and markdown output
  • expand compatibility corpus evidence for preserve-only workbook content including external links, custom XML, connections, VBA, embedded packages, OLE objects, and form controls
  • add integrated template/formula/chart/pivot/PDF workflow coverage plus job-oriented examples and docs
  • reduce OfficeIMO.Examples nullable warning noise without adding benchmark or CI work

Validation

  • dotnet build .\OfficeIMO.Excel\OfficeIMO.Excel.csproj -c Release --no-restore -v:minimal
  • dotnet build .\OfficeIMO.Examples\OfficeIMO.Examples.csproj -c Release --no-restore -v:minimal
  • dotnet test .\OfficeIMO.Tests\OfficeIMO.Tests.csproj --framework net8.0 --filter "FullyQualifiedNameFeatureReport_Preflight|FullyQualifiedNameCompatibility_Corpus_PreserveOnlyMetadata_RoundTripsAndBlocksRiskyWorkflows|FullyQualifiedNameCompatibility_Corpus_MacroEmbeddedObjectsAndControls_RoundTripAndBlockRiskyWorkflows|FullyQualifiedNameReportWorkflow_TemplateFormulaChartPivot_PreflightsAndExportsPdf" --no-build --logger "console;verbosity=minimal"
  • dotnet test .\OfficeIMO.Tests\OfficeIMO.Tests.csproj --framework net8.0 --filter "FullyQualifiedName~Compatibility_Corpus" --no-restore --logger "console;verbosity=minimal"

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e338b05e87

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread OfficeIMO.Excel/ExcelFeatureReport.Preflight.cs Outdated
Comment thread OfficeIMO.Excel/ExcelFeatureReport.Preflight.cs Outdated
Comment thread OfficeIMO.Excel/ExcelFeatureReport.Preflight.cs Outdated
Comment thread OfficeIMO.Excel/ExcelFeatureReport.Preflight.cs Outdated
@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 67.88991% with 210 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.42%. Comparing base (c8ac579) to head (10ae271).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
OfficeIMO.Excel/ExcelFeatureReport.PdfPreflight.cs 44.10% 135 Missing and 31 partials ⚠️
OfficeIMO.Excel/ExcelFeatureReport.Preflight.cs 79.16% 20 Missing and 15 partials ⚠️
OfficeIMO.Excel/ExcelFeatureReport.cs 96.19% 3 Missing and 4 partials ⚠️
...MO.Excel/ExcelDocument.CalculationAndProtection.cs 60.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1979      +/-   ##
==========================================
- Coverage   73.43%   73.42%   -0.01%     
==========================================
  Files        2541     2548       +7     
  Lines      288094   288829     +735     
  Branches    61942    62114     +172     
==========================================
+ Hits       211563   212083     +520     
- Misses      48375    48528     +153     
- Partials    28156    28218      +62     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8626839ed7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread OfficeIMO.Excel/ExcelFeatureReport.cs Outdated
Comment thread OfficeIMO.Excel/ExcelFeatureReport.cs Outdated
Comment thread OfficeIMO.Excel/ExcelFeatureReport.Preflight.cs Outdated
Comment thread OfficeIMO.Excel/ExcelFeatureReport.Preflight.cs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0d55c43734

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread OfficeIMO.Excel/ExcelFeatureReport.Preflight.cs
Comment thread OfficeIMO.Excel/ExcelFeatureReport.cs Outdated
Comment thread OfficeIMO.Excel/ExcelFeatureReport.Preflight.cs Outdated
Comment thread OfficeIMO.Excel/ExcelFeatureReport.Preflight.cs
Comment thread OfficeIMO.Excel/ExcelFeatureReport.cs Outdated
Comment thread OfficeIMO.Excel/ExcelFeatureReport.Preflight.cs
Comment thread OfficeIMO.Excel/ExcelFeatureReport.Preflight.cs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c188fca75a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread OfficeIMO.Excel/ExcelFeatureReport.Preflight.cs Outdated
Comment thread OfficeIMO.Excel/ExcelFeatureReport.cs
Comment thread OfficeIMO.Excel/ExcelFeatureReport.cs
Comment thread OfficeIMO.Excel/ExcelFeatureReport.cs
Comment thread OfficeIMO.Excel/ExcelFeatureReport.Preflight.cs Outdated
Comment thread OfficeIMO.Excel/ExcelFeatureReport.cs
Comment thread OfficeIMO.Excel/ExcelFeatureReport.cs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7c70eb2262

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread OfficeIMO.Excel/ExcelFeatureReport.PdfPreflight.cs Outdated
Comment thread OfficeIMO.Excel/ExcelFeatureReport.cs
Comment thread OfficeIMO.Excel/ExcelFeatureReport.cs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ab44e38886

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread OfficeIMO.Excel/ExcelFeatureReport.Preflight.cs
Comment thread OfficeIMO.Excel/ExcelFeatureReport.Preflight.cs
Comment thread OfficeIMO.Excel/ExcelFeatureReport.Preflight.cs
Comment thread OfficeIMO.Excel/ExcelFeatureReport.cs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 10ae2714ed

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

return false;
}

if (!OfficeImageReader.TryIdentify(bytes, null, out OfficeImageInfo imageInfo)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Validate images with the PDF writer

When a worksheet image is declared as PNG/JPEG but only has a recognizable header or otherwise uses a PNG payload the PDF writer rejects, this preflight returns supported because it stops at OfficeImageReader.TryIdentify. The export path later calls TryValidatePdfImageBytes and skips those images with a warning, so CanExportPdfReport can still approve a report that drops visuals; use the same PDF byte validator here.

Useful? React with 👍 / 👎.

Comment on lines +48 to +49
foreach (var section in EnumerateHeaderFooterSections(headerFooter)) {
if (!TryGetUnsupportedHeaderFooterFormattingReason(section.Text, out string reason)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Detect mixed header/footer styles

When one header/footer zone uses a line-level style that the PDF exporter can only apply if it is shared across all zones, for example left &BTotal and center Page &P, each section passes this independent scan and CanExportPdfReport remains true. The exporter later compares the resolved styles across left/center/right and first/even/default zones, warns about mixed formatting, and simplifies the header/footer, so preflight misses a PDF formatting loss.

Useful? React with 👍 / 👎.

Comment on lines +520 to +522
var pdfExportFormulas = formulas.Formulas
.Where(formula => defaultPdfExportSheetNames.Contains(formula.SheetName))
.ToArray();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Scope PDF formula checks to exported cells

When a visible worksheet has an unsafe formula cache only outside the default PDF export range, such as a dirty formula outside a single print area or in a hidden row/column, this sheet-name-only filter still adds PDF-missing/dirty formula caches and blocks ExportPdfReport. The default exporter reads the configured print area and respects hidden rows/columns before collecting cell values, so those formulas are never rendered and preflight rejects a PDF the default path can produce without touching them.

Useful? React with 👍 / 👎.

Comment on lines +139 to +140
if (!TrySkipHeaderFooterFontToken(text, ref i)) {
reason = "malformed font formatting";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Validate header/footer font tokens

When a header/footer starts with a quoted font token whose family the PDF font mapper cannot apply, for example &"UnmappedFont"Report, this scan skips the token and treats the section as PDF-safe because no visible text has been seen yet. The exporter later calls TryApplyHeaderFooterFontToken, emits a WorksheetHeaderFooterFormatting warning when mapping fails, and simplifies the header/footer, so CanExportPdfReport can approve a report with known formatting loss.

Useful? React with 👍 / 👎.

ExcelSheet.HeaderFooterSnapshot headerFooter = excelSheet.GetHeaderFooter();
AddUnsupportedHeaderFooterImages(headerFooter, sheetName, ref pdfUnsupportedImageCount, pdfUnsupportedImageDetails);
AddUnsupportedHeaderFooterFormatting(headerFooter, sheetName, ref pdfUnsupportedHeaderFooterFormattingCount, pdfUnsupportedHeaderFooterFormattingDetails);
AddUnsupportedPrintArea(excelSheet, sheetName, ref pdfUnsupportedPrintAreaCount, pdfUnsupportedPrintAreaDetails);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Add print-title columns to PDF preflight

When a visible worksheet defines print-title columns, this print-layout preflight can still pass because it only checks multi-area print areas and never records GetPrintTitles().HasColumns. The default PDF export path only has UseWorksheetPrintTitleRows handling and prepends repeated rows, so workbooks that expect left columns repeated on each printed page are approved even though those print-title columns are ignored in the generated PDF.

Useful? React with 👍 / 👎.

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.

1 participant