# Compressed HTML reports

Compressed HTML reports on Evotec with installation guidance, setup notes, reference details, and project documentation.

Project

UltimateHtmlViewer

SPFx web part for hosting HTML dashboards in modern SharePoint pages, with deep-link navigation, inline rendering, security controls, and deployment automation.

[View on GitHub](https://github.com/EvotecIT/UltimateHtmlViewer) [Visit Website](#) [Releases](https://github.com/EvotecIT/UltimateHtmlViewer/releases/tag/v1.0.32.43) [Changelog](#) [Get package](#)

Stars**23**

Forks**3**

Open issues**0**

NuGet downloads

Release**v1.0.32.44**

Language: TypeScript Updated: 2026-11-29

Documentation

Store and open gzip-compressed HTML reports in SharePoint with UltimateHtmlViewer.

Store a report as `report.html.gz` or `report.htm.gz` to reduce the file size in SharePoint and the bytes downloaded by the viewer. UltimateHtmlViewer expands the file in the browser and opens it with the same URL policy, iframe sandbox, and content security policy as the corresponding HTML file. This works with HTML from PSWriteHTML, HtmlForgeX, and other generators.

## Open a compressed report

1. Upload the gzip file to your report library.
2. Choose **SharePoint file content** or **SharePoint file blob URL** in the web part. Set the source to the compressed file, or pick it in the report browser.
3. To share a particular report in the viewer, enable the page query override and use **Open in new tab**. The new tab loads the viewer with the report selected. **Download HTML** saves a local, expanded copy.

An extension list that allows `.html` or `.htm` also allows its gzip form. You can list `.html.gz` and `.htm.gz` individually. The viewer limits expanded gzip reports to **256 MiB** by default. To adjust it, set **Maximum expanded gzip report size (MiB)** or `maxInflatedReportMiB` in the viewer configuration. The supported range is 1–384 MiB. Use a current browser with gzip support through `DecompressionStream`. The loading indicator shows bytes expanded as the report opens and offers a **Cancel** button.

## Publish a file or folder

Run the helper with PnP.PowerShell and the Entra application you use for SharePoint administration.

```powershell
./scripts/Publish-UHVGzipReport.ps1 -Path ./Report.html `
    -SiteUrl https://contoso.sharepoint.com/sites/Reports `
    -Folder SiteAssets/Reports -ClientId '<application-id>'
```

Pass the report directory as `-Path` to publish a folder. The helper appends `.gz` to each HTML file and preserves relative paths. CSS, JavaScript, images and JSON manifests are uploaded as-is. Set the web part to the compressed entry page. When an allowed link or nested iframe asks for an original HTML path and SharePoint returns 404, the viewer looks for the gzip file in the same folder. The original HTML takes precedence if both copies exist. SharePoint permissions still apply to each request.

Use a single gzip member per report. If a browser rejects a file made by concatenating gzip members, run the publishing helper on the original HTML to produce a single member.

The helper can replace files with matching destination names. Use `-WhatIf` to preview an upload, or `-OutputDirectory ./StagedReport` in place of the SharePoint parameters to stage the files locally. Nested iframe hydration uses the viewer's existing same-origin access. A script-only sandbox supports the navigation bridge and limits host access to nested frame documents.

## Measured sizes

Sizes are decimal MB, rounded. The compression ratio depends on the report and the data it already compresses. HtmlForgeX 3 can compress data inside a report. That compact content is still available when the entire file is also stored with gzip.

| Input | HTML or original folder | Gzip file or compressed folder |
| --- | --- | --- |
| Report | 9.0 MB | 1.6 MB |
| Report | 12.7 MB | 2.6 MB |
| Report folder | 219.6 MB | 19.7 MB |
| Synthetic PSWriteHTML-style table | 118 MB | 19.6 MB |
| Local browser inventory fixture | 150.7 MB | 23.7 MB |

The browser still renders the full HTML. The 150.7 MB inventory uses paged table data and renders 20 rows at first paint. Its loopback timing and memory measurements are in the [browser check instructions](https://github.com/EvotecIT/UltimateHtmlViewer/tree/master/spfx/UniversalHtmlViewer/test/browser).

## SharePoint Online

Microsoft documents REST `/$value` as the endpoint for reading file contents and lists no general blocked-file-type list for SharePoint in Microsoft 365. Site download restrictions, unmanaged-device policies, and Microsoft's malware handling can affect file access. The viewer uses the same authenticated REST file endpoint for both formats and does not retry a denied request using a different path. [File REST API](https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-folders-and-files-with-rest), [File type restrictions](https://support.microsoft.com/en-us/sharepoint/data-and-lists/types-of-files-that-cannot-be-added-to-a-list-or-library), [Site download policy](https://learn.microsoft.com/en-us/sharepoint/block-download-from-sites), [Unmanaged device policy](https://learn.microsoft.com/en-us/sharepoint/control-access-from-unmanaged-devices), [Malware handling](https://learn.microsoft.com/en-us/defender-office-365/anti-malware-protection-for-spo-odfb-teams-about).

Tenant-specific upload acceptance, malware scanning of the gzip contents, and the exact `Content-Type`, `Content-Disposition`, and `Content-Encoding` returned for `.gz` still need a tenant check. Upload a harmless sample in the target library and confirm a regular reader can open it in the viewer. The browser check covers a file response served as a gzip attachment.

<!-- PowerForge markdown artifact sha256:08C166722B177AB80D5666F7B33D36B16BFE7B7EE0F29DCBE67CEC5FF5A813CF -->
