Files
docs.datacontroller.io/docs/embed-va.md
T
allan dec5f239de
Publish to docs.datacontroller.io / Deploy docs (push) Successful in 1m4s
fix: embed va
2026-07-01 13:12:22 +01:00

47 lines
2.2 KiB
Markdown

---
layout: article
title: SAS Visual Analytics Embed
description: Embed the Data Controller editor inside a SAS VA report as a data-driven content object. Row selections in the VA report drive filters and column visibility in the editor.
---
# Embedding inside SAS Visual Analytics
Data Controller can be embedded inside a SAS Visual Analytics report as a **data-driven content** (DDC) object. This unlocks scenarios where a user can safely modify the values in an underlying SAS table, and have the visualisation updated- all from inside the same report.
## URL
Open the editor as a DDC by appending `?embed=va` to the editor route:
```
`https://yourserver/DC/#/editor/<library>/<table>?embed=va`
```
The `?embed=` parameter accepts three values:
| Value | Behaviour |
|---|---|
| `true` | Chrome (header, back button, sub-nav) is hidden. Editor opens in its normal read-only / Filter mode. |
| `va` | Same chrome-hiding as `true`, **plus** editor starts in edit mode, "Add Row" / Cancel / top action buttons are hidden, and a single bottom **Submit** button is rendered. |
| `false` (or omitted) | Standard interactive UI. |
## How VA drives the editor
VA pushes a JSON payload to the iframe via `window.postMessage` whenever the selected rows change. Data Controller listens for these messages and:
1. Resolves each VA `parameter` to a DC column by matching on column label.
2. Builds a filter (using existing [Filter](/filter/) machinery) over the selected values.
3. Hides any VA columns marked as `brush` so the grid stays focused on the user-editable columns (except primary key cols which are always shown)
If VA sends an empty / unmatched message the editor falls back to the unfiltered view but stays in VA mode.
## Security
Only postMessage events from the hosting parent frame (or the same origin in
dev/tests) are honoured - see [`VaMessagingService.isTrustedSource()`](
https://git.datacontroller.io/dc/dc/src/branch/main/client/src/app/services/va-messaging.service.ts).
## Configuration in VA
In the VA Report Designer, add a **Data-Driven Content** object and set the URL to the editor route shown above. Be sure that any report level filters have their corresponding parameters added to the DDC object itself.