Skip to content
JTS

Loading advanced system settings…

How we ended up generating "real-time" reports without Power BI (and without losing our minds)

Knowledge article · 14 Dec 2025

Source
LinkedIn
Status
Published

Content

Dynamic, on-demand PDF reports from a portal, filling an Excel template with Office Scripts from Power Automate so the result is deterministic.

Summary of the article published on LinkedIn (in Spanish). “View original” opens the full text with the sample script and flow.

The challenge

A client wanted their portal to generate dynamic reports from filters and return them as a PDF instantly, with complex business logic, always up-to-date data and no extra licensing costs.

What we ruled out

  • Power BI Embedded: powerful, but costly and awkward for an embedded, per-user scenario.
  • Native Dynamics templates: not flexible enough for the complexity.
  • Excel/Word templates from code in a Custom API or Workflow Activity: required an external DLL.
  • Azure Function: clean and scalable, but more implementation time than we had.
  • Excel connectors in Power Automate: non-deterministic refresh; the PDF was sometimes generated before the new data showed up.

What actually worked

The issue was latency when writing to Excel. Instead of creating rows with connectors and waiting, an Office Script inserts the report lines it receives as parameters:

  1. Get the template with its tables and charts.
  2. Create a copy in OneDrive from its file content (faster than the copy connectors).
  3. Fetch the data and fill the template by calling the script.
  4. Convert the document to PDF.
  5. Return the PDF as base64 for the client to download.

Result: a deterministic flow and the report in the user’s hands immediately.

General

Published
14 Dec 2025
Source
LinkedIn