58 lines
2.3 KiB
Markdown
58 lines
2.3 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
|
|
selects a row in a VA visualisation and is immediately able to edit the
|
|
corresponding row(s) in a SAS table - 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 primary-key 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)
|
|
4. Navigates to `/editor/<table>/<FILTER_RK>?embed=va` so the filtered view is
|
|
shareable and survives reloads.
|
|
|
|
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. Map the report data items so they include the
|
|
primary key column(s) of the target DC table. |