Advanced Spreadsheets and Reporting Documentation
Index

AI Reports Setup & Data Privacy

Before the first report can be generated, an administrator connects an AI provider and, optionally, sets the house style and limits every report follows. This page also explains exactly which data leaves Business Central when a report is generated.

Prerequisites

  • The AL AI Services and AL Compiler and Interpreter apps (Hougaard) are installed. They are dependencies of Advanced Spreadsheets and Reporting and are installed with it.
  • Outgoing HTTP requests are allowed. In Extension Management, open AL AI Services → Configure and switch on Allow HttpClient Requests. Without it every run fails with "Allow HttpClient Requests" is turned off for this extension.
  • Users have a permission set of this app (AFR_Hgd or AFR_READONLY_Hgd). Both include every AI report object; see Permission Sets below.
  • An account with an AI provider and an access key (API key) for it.

Step 1: Configure an AI Provider

Open AI Providers: the AI Provider action on AI Report Instructions, AI Providers on AI Report Setup, or AI Provider Setup on the app's menu page. The page is shared with the Spreadsheet Agent.

Field What to enter
Provider The service: Azure Open AI, ChatGPT Open AI, Anthropic (Claude), Google Gemini, xAI Grok, Mistral, DeepSeek, Moonshot Kimi, Alibaba Qwen, Zhipu GLM, MiniMax or LM Studio (a model you host yourself). Each provider can be set up once.
Endpoint The chat API URL as your provider documents it. For Azure OpenAI, the deployment's chat completions URL in your Azure resource; for LM Studio, the address of your server.
Access Key The provider's API key. It is masked on the page. Drilling down opens the provider's key management site.
Model The model name, as the provider spells it.
Spreadsheet Agent Use this provider for the spreadsheet agent.
AI Report Agent Use this provider for AI reports, both unattended runs and the designer.

Switch AI Report Agent on for exactly one provider. If no provider has it, AI reports use the provider marked Spreadsheet Agent. With neither, generation fails with No AI provider is set up for AI reports. Each report records the provider and model that wrote it.

Choosing a model

The report agent needs a model that supports tool calling (function calling) and has a large context window. A run is a conversation of many round trips: every query result, financial report grid and draft of the page is part of the conversation the model reads on the next round. Use a current flagship or strong mid-tier model from your provider. Small or local models often call tools wrongly or stop before the page is written.

Cost grows with the number of round trips and the size of the data returned. The limits below cap both.

Step 2: AI Report Setup

Open AI Report Setup (search, the Setup action on the instructions list, or the menu page). The page has two sections.

House Style

A large text editor for the Global Style Prompt: rules every AI report follows, added to the agent's instructions on every run and in the designer. It is saved as you type. Use it for what should be the same in every report:

  • brand or accent colour and fonts,
  • number formats (thousands, decimals, negative numbers),
  • language and tone,
  • mandatory sections (for example a cash position or a "notes and data sources" section),
  • wording conventions (for example "net revenue", never "sales").

Example:

Use #1E4FA0 as the accent colour. Show amounts in thousands with no decimals and negative numbers in parentheses. Write in Danish. Always end with a "Notes and data sources" section. Call revenue "Net revenue".

Leave it empty to use the built-in defaults: accent colour #0F6CBD, green and red only for favourable and unfavourable changes, a system font stack, print-friendly layout, about 1100 px content width. Keep report-specific content out of the house style; that belongs in each instruction's prompt.

Generation Limits

Field Default Range Meaning
Max. Tool Rounds 40 1–500 The most model round trips one generation may take. Each round trip is one answer from the AI, usually with a few tool calls. A run that reaches the limit stops as Failed with The agent did not finish within N model round trips; any page written so far is kept. 40 is enough for a thorough report; raise it for very large reports. The agent is told the limit and plans for roughly 10–15 data calls, 3–8 graphics and 2–4 writing calls.
Max. SQL Rows per Query 500 1–5000 The most rows one data query may return. A larger result is cut off, and the agent is told to aggregate (GROUP BY) or filter instead of totalling a truncated list. Keeps runs fast and conversations small.
Default Reports to Keep 0 0 or more The Reports to Keep value new instructions start with. 0 keeps every report.

The actions AI Providers and Instructions open those pages.

Permission Sets

Both permission sets of the app include every AI report table, page and codeunit:

Permission set AI reports
AFR_Hgd Full use.
AFR_READONLY_Hgd Full use as well. AI reports never write business data, so the read-only set is sufficient to create instructions, generate, design and view reports.

Which instructions and reports a user can open is decided per object by its permission list. See Permissions.

The agent reads data with the rights of the user who runs it. When that user may not read a table or company, the agent's query fails. The agent is instructed to say so in the report instead of guessing. For scheduled runs that user is the job queue entry's user; see Generating & Scheduling.

Data and Privacy

AI reports send business data to the AI provider you configure. Nothing is sent to Hougaard. Review your provider's data processing terms before you enable the feature.

What is sent to the AI provider

During a run or a designer session, the conversation sent to the provider contains:

  • The agent's instructions:
    • the company name and Business Central company name,
    • the local currency code,
    • today's date and the work date,
    • the report period and comparison period,
    • the instruction code, description and prompt,
    • the house-style prompt.
  • Results of every tool call:
    • table and field definitions,
    • query results (up to Max. SQL Rows per Query rows per query),
    • financial report grids (line descriptions and amounts),
    • the values of saved spreadsheet cells the agent reads,
    • the names and descriptions of the company's financial reports and of the spreadsheets the user may open.
  • The HTML of the report while it is written and read back.
  • In the designer, also your chat messages and, when you ask for it, the HTML of an earlier report loaded as a starting point.

Charts, KPI tiles, sankey diagrams and Mermaid diagrams are rendered inside Business Central. The agent sends the numbers and gets back a placeholder. The finished drawing is inserted when the report is stored and is never sent to the provider.

What is stored in Business Central

Data Where How long
The report page (HTML, including all figures it shows) AI report record Until deleted, or pruned by Reports to Keep
The agent's closing summary, error message, tool call count, provider and model AI report record As above
The generation log: the prompts, the AI's messages and every tool call with its parameters (for example the SQL text). Tool results are not stored. AI report record As above
Instructions (prompt, formulas) and the house-style prompt Instruction and setup records Until deleted
Permission lists AI report permission records With their instruction or report

Deleting an instruction deletes all its reports, permission lists and job queue entries. A downloaded .html file is a copy outside Business Central and is governed by wherever you keep or send it.

Keeping data in your control

  • Azure OpenAI runs the model in your own Azure subscription, under your organisation's agreement with Microsoft.
  • LM Studio runs a model on a server you operate; the data does not leave your network. Check that the model is strong enough (see Choosing a model).
  • Use permission lists and Business Central permissions so that only appropriate users run reports on sensitive data. The agent can never see more than the user who runs it.
  • Point instructions at financial reports and saved spreadsheets with page regions. The agent then reads aggregated, presentable figures instead of raw ledger lines.

See also the app's Privacy Policy.