Skip to content

XLSX report export + HTML report Results/Payload toggle improvements#652

Open
sivaprabug wants to merge 6 commits intoDMTF:mainfrom
sivaprabug:enhancement/reports-and-payload-views-at-sametime
Open

XLSX report export + HTML report Results/Payload toggle improvements#652
sivaprabug wants to merge 6 commits intoDMTF:mainfrom
sivaprabug:enhancement/reports-and-payload-views-at-sametime

Conversation

@sivaprabug
Copy link
Copy Markdown
Contributor

@sivaprabug sivaprabug commented Mar 29, 2026

Description

This PR introduces two major enhancements to the Redfish Service Validator reporting system:

  1. A new machine-readable XLSX report generated automatically alongside the existing HTML report on every validation run.
  2. An improved HTML report panel toggle with a new "Both" button for viewing Results and Payload simultaneously.

Motivation

Previously, validation results were only available in an HTML report — useful for human review but difficult to process programmatically, filter, sort, or share in enterprise environments. This PR adds an Excel-compatible spreadsheet export that makes the data immediately actionable in tools like Excel, LibreOffice, Google Sheets, or any data pipeline that reads .xlsx files.

Additionally, the HTML report required toggling back and forth between the property table and raw JSON payload. The new "Both" view eliminates that friction.


Changes

requirements.txt

  • Added openpyxl (pure-Python, no native build dependencies) as a runtime dependency to support XLSX generation.

report.py

HTML Report — Button Toggle Improvements

  • Added .btn-both CSS style (green, #198754) to the existing button group.
  • Updated build_resource_header() to render three buttons per resource card:
    • Results — shows the property validation table only; resets "Both" button if active.
    • Payload — shows the raw JSON payload only; resets "Both" button if active.
    • Both — shows both the table (top) and JSON payload (bottom) simultaneously. Button label changes to ▲ Hide.
    • ▲ Hide (label when Both is active) — collapses both panels; button reverts to ☷ Both.
  • Fixed the previous toggle logic which used classList.toggle() — replaced with explicit classList.add() / classList.remove() for deterministic state management.

New xlsx_report() Function

Generates RedfishServiceValidatorReport_<timestamp>.xlsx in the same report directory as the HTML file.

Sheet 1 — Summary

  • Title row (merged, blue header).
  • System information: tool version, generated timestamp, host, user, product, manufacturer, model, firmware version.
  • Result counts: Pass, Warning, Fail, Not Tested — each row colour-coded (green/amber/red/grey).
  • Gridlines hidden for a clean presentation.

Sheet 2 — Results

  • Columns: S#, URI, Resource Type, Property, Value, Result, Message.
  • S# column — sequential serial number for every property row, enabling easy reference.
  • URI and Resource Type filled on every row for clarity — no blank cells.
  • First row of each URI group is bold with a distinct blue background to visually mark the start of a new resource block.
  • Result cells are colour-coded: green (PASS), red (FAIL), amber (WARN), grey (SKIP).
  • All cells have solid black borders on all 4 sides.
  • All data cells are horizontally and vertically centered.
  • wrap_text=False on data cells to prevent Excel from auto-expanding row heights and creating visual empty rows.
  • [Link to: <path>] values are unwrapped to display the bare path (e.g. /redfish/v1/Managers/bmc).
  • Auto-filter enabled on the header row — all 7 columns filterable.
  • Top row frozen (freeze panes at A2) so the header stays visible while scrolling.
  • Gridlines hidden for a clean presentation.

console_scripts.py

  • Calls report.xlsx_report() immediately after report.html_report().
  • Logs the XLSX output path: XLSX Report: <path>.

Testing

  • Verified clean Python 3 imports: python3 -c "from redfish_service_validator import report"
  • Ran full validation against a live BMC endpoint and confirmed:
    • Both HTML and XLSX files generated with matching timestamps.
    • All resource rows populate correctly with S#, URI, and Resource Type on every row.
    • Bold first-row grouping renders correctly across all resources.
    • Result colours, borders, and alignment correct in Excel, LibreOffice, and Google Sheets.
    • Both/Hide toggle functions correctly in Chrome, Firefox, and Edge.
    • Clicking Results or Payload while Both is active correctly resets the button state.

Notes

  • No changes to CLI arguments, configuration, or existing HTML report structure.
  • No breaking changes — all existing behaviour preserved.
  • openpyxl is a well-maintained, widely adopted library (PyPI: openpyxl).
  • The XLSX file is fully self-contained and requires no special software beyond a standard spreadsheet application.

Checklist

  • Code follows existing project style and conventions
  • No new CLI flags or config changes required
  • requirements.txt updated
  • Tested against a live BMC endpoint
  • No regressions to existing HTML report functionality

📊 Sample Reports

Report Name Link
Ubuntu Terminal Output View Log
Redfish Service Validator Debug Log View Debug Log
Redfish Service Validator Report (HTML) View HTML Report
Redfish Service Validator Report (Excel) Download Excel

Add 'Both' button functionality to HTML report for toggling results and payload visibility

Related Pull Request :

DMTF#648

DMTF#650

Signed-off-by: Sivaprabu Ganesan <sivaprabug@ami.com>
Add XLSX report generation and update requirements

Signed-off-by: Sivaprabu Ganesan <sivaprabug@ami.com>
@sivaprabug sivaprabug changed the title Enhance Both button functionality Handling reports and payload button action and Spreadsheet report Mar 30, 2026
Aligned junk characters and unwanted spaces

Signed-off-by: Sivaprabu Ganesan <sivaprabug@ami.com>
@sivaprabug sivaprabug changed the title Handling reports and payload button action and Spreadsheet report XLSX report export + HTML report Results/Payload toggle improvements Mar 30, 2026
@mraineri
Copy link
Copy Markdown
Contributor

This is great! Could we also have a "hide" option for the existing "Results" and "Payload" buttons like there is with the "Both" option?

Review comment Addressed:

DMTF#652 (comment)

CC: @mraineri

Signed-off-by: Sivaprabu Ganesan <sivaprabug@ami.com>
Review comment Addressed:

DMTF#652 (comment)

CC: @mraineri

Signed-off-by: Sivaprabu Ganesan <sivaprabug@ami.com>
@sivaprabug
Copy link
Copy Markdown
Contributor Author

This is great! Could we also have a "hide" option for the existing "Results" and "Payload" buttons like there is with the "Both" option?

Hi @mraineri

Thanks for the suggestion!

I’ve implemented the requested changes accordingly. Kindly refer to the attached report for details.

Please take a look and let me know if this aligns with your expectations or if any further adjustments are needed.

Thanks!

RedfishServiceValidatorReport_03_30_2026_210716.html

@mraineri
Copy link
Copy Markdown
Contributor

Looks great to me! I'll pass it around to others for more feedback

@jautor
Copy link
Copy Markdown
Contributor

jautor commented Mar 30, 2026

This is very helpful! From the other PR - it would be good to fix the "copy" button so it produces better-formatted output (probably plain text or markdown columns?) that can be easily pasted into issues or emails. The whole spreadsheet has the "best" output for this, so the resource-specific copy function can be simple.

- Replace plain-text copy with a Markdown table formatter for the
  Results panel Copy button

- Extracted shared _doCopy() helper; copyToClipboard() and the new
  copyTableAsMarkdown() both delegate to it

- copyTableAsMarkdown() reads the rendered <table> DOM, builds
  | col | col | rows with a separator line after the header, and
  escapes any pipe characters inside cell content

- Fix Python double-escape: \n and \| in the JS regex/string
  literals are now correctly rendered in the generated HTML

- Copy JSON button on the Payload panel is unchanged

Addressed the review comments:

DMTF#652 (comment)

CC:  @mraineri @jautor

Signed-off-by: Sivaprabu Ganesan <sivaprabug@ami.com>
@sivaprabug
Copy link
Copy Markdown
Contributor Author

This is very helpful! From the other PR - it would be good to fix the "copy" button so it produces better-formatted output (probably plain text or markdown columns?) that can be easily pasted into issues or emails. The whole spreadsheet has the "best" output for this, so the resource-specific copy function can be simple.

Hi @jautor

Thanks for the suggestion — that makes a lot of sense.

I’ve updated the Results panel Copy button to generate a Markdown-formatted table instead of plain text, so it can be easily pasted into issues or emails. The implementation keeps the resource-specific logic simple while aligning the output more closely with the spreadsheet-style format you mentioned.

The JSON copy functionality remains unchanged.

Sample Reports ( Based on OpenBMC - 2600 SOC ) :

RedfishServiceValidatorDebug_03_31_2026_081623.log

RedfishServiceValidatorReport_03_31_2026_081623.html

RedfishServiceValidatorReport_03_31_2026_081623.xlsx

Sample URI :

image

Copy Results (Supports Markdownformat) :

| Property | Value | Result |
| :--- | :--- | :---: |
| @odata.context | [Not Present] | SKIP |
| @odata.etag | [Not Present] | SKIP |
| @odata.id | /redfish/v1/TelemetryService/Triggers | PASS |
| @odata.type | #TriggersCollection.TriggersCollection | PASS |
| Description | [Not Present] | SKIP |
| Members | [Array] | PASS |
| Members@odata.count | 0 | PASS |
| Members@odata.nextLink | [Not Present] | SKIP |
| Name | Triggers Collection | PASS |
| Oem | [Not Present] | SKIP |

Preview looks like below

Property Value Result
@odata.context [Not Present] SKIP
@odata.etag [Not Present] SKIP
@odata.id /redfish/v1/TelemetryService/Triggers PASS
@odata.type #TriggersCollection.TriggersCollection PASS
Description [Not Present] SKIP
Members [Array] PASS
Members@odata.count 0 PASS
Members@odata.nextLink [Not Present] SKIP
Name Triggers Collection PASS
Oem [Not Present] SKIP

Json Data :

{
    "@odata.id": "/redfish/v1/TelemetryService/Triggers",
    "@odata.type": "#TriggersCollection.TriggersCollection",
    "Members": [],
    "Members@odata.count": 0,
    "Name": "Triggers Collection"
}

@sivaprabug
Copy link
Copy Markdown
Contributor Author

Hi @jautor / @mraineri

Any review comments ?

@mraineri
Copy link
Copy Markdown
Contributor

mraineri commented Apr 1, 2026

Nothing else on my end; I expect this will be formally approved on the next tools call

@sivaprabug
Copy link
Copy Markdown
Contributor Author

Nothing else on my end; I expect this will be formally approved on the next tools call

Thanks @mraineri

Based on the feedback, we will enhance the other tools as time permits.

@mraineri
Copy link
Copy Markdown
Contributor

mraineri commented Apr 2, 2026

Nothing else on my end; I expect this will be formally approved on the next tools call

Thanks @mraineri

Based on the feedback, we will enhance the other tools as time permits.

I would recommend holding off on the Interop Validator for some time; we plan on overhauling it like we did with the service validator recently. I'm glad you're planning on taking this through the other tools though!

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.

3 participants