In this series, we’ll build an end‑to‑end pipeline that can:
This first article sets the stage: what each technology does, why it’s a good fit, and how they connect.
Articles in this series:
From SAS Visual Analytics to Pixel‑Perfect PDFs with a Local LLM (Part 1): Meet the Tech Stack (this article)
From SAS Visual Analytics to Pixel‑Perfect PDFs with a Local LLM (Part 2): Understanding the Buildin...
Many teams build great reports in Visual Analytics, but then need to export, distribute, archive, and brand them consistently—often outside the interactive VA user interface. The Visual Analytics REST APIs provide structured ways to export report content (PDF, images, data extracts) and even perform some report operations programmatically.
From there, ReportLab gives you full control to create “print‑ready” PDFs: layout, typography, headers/footers, page templates, tables, charts, and more—without relying on a browser renderer.
Finally, Ollama allows you to run an LLM locally and call it over an API, so you can add narrative text (executive summaries, explanations, key takeaways) while keeping data in your environment.
SAS provides a dedicated Visual Analytics API that focuses on “basic tasks with reports,” such as exporting PDFs and images, exporting data, and working with report packages.
The API groups endpoints around common output needs, including direct exports like:
The Visual Analytics API also includes a report operation endpoint (/visualAnalytics/reports) that accepts a list of operations executed sequentially (all must succeed for persistence). Supported operations include:
This matters because it opens the door to parameter-driven automation: e.g., update parameters, export an image, then assemble a final deliverable.
In this series, we’ll primarily leverage the export capabilities (images/data) as building blocks for a custom PDF “report pack” produced in Python.
ReportLab is a Python library that lets you directly generate PDF documents programmatically. It also supports charts and graphics in bitmap/vector formats and is designed for high-volume, automated document production.
The user guide highlights a practical point: PDF is a complex binary format and not something you realistically “hand craft.” ReportLab provides a direct PDF generation approach—no “print driver” and no intermediate step—often making automated report generation much faster and more controllable than UI-driven pipelines.
ReportLab offers multiple abstraction layers:
PLATYPUS is particularly useful for multi-page documents because it separates content from layout decisions, using concepts like DocTemplates, PageTemplates, Frames, and Flowables.
Visual Analytics exports can give you:
ReportLab can then:
For more information about ReportLab.
Ollama is positioned as an easy way to get up and running with large language models locally, and it provides an API reference you can call from your applications.
The API includes endpoints like:
In many reporting scenarios, the primary concerns are data governance and cost control:
In this series, we’ll use Ollama as an optional “narration engine”—for example: generating executive summaries from metrics, writing captions for visuals, or explaining anomalies—while keeping the report assembly deterministic and auditable in Python.
For more information about Ollama.
Here’s the mental model we’ll implement across the series:
To follow along later, you’ll want:
By combining:
…you get a workflow that is automatable, auditable, and enterprise-friendly: great for scheduled deliveries, CI/CD style promotion of report assets, or producing “board pack” PDFs at scale.
Articles in this series:
From SAS Visual Analytics to Pixel‑Perfect PDFs with a Local LLM (Part 1): Meet the Tech Stack (this article)
From SAS Visual Analytics to Pixel‑Perfect PDFs with a Local LLM (Part 2): Understanding the Buildin...
Find more articles from SAS Global Enablement and Learning here.
Dive into keynotes, announcements and breakthroughs on demand.
Explore Now →The rapid growth of AI technologies is driving an AI skills gap and demand for AI talent. Ready to grow your AI literacy? SAS offers free ways to get started for beginners, business leaders, and analytics professionals of all skill levels. Your future self will thank you.