Files
docs.datacontroller.io/docs/dcu-tableviewer.md
T
dc 8c57e14493 docs(viewer): the Markdown and PDF report download options
The Download list stopped at TSQL DDL, but the modal has offered Markdown
for a while and now offers a server-side PDF report as well (dc/dc#432).

The PDF report is the typeset one: SAS formats and labels applied,
landscape, headers repeated per page, and a footer carrying the filter,
user, timestamp and page number, capped at 2000 rows with the cap stated
when it is reached.
2026-11-02 23:08:33 +00:00

61 lines
4.2 KiB
Markdown

# Data Controller for SAS: Viewer
The viewer screen provides a raw view of the underlying table.
Choose a library, then a table, and click view to see the first rows - up to the `DC_MAXOBS_WEBVIEW` limit, 2,000 rows by default.
A filter option is provided should you wish to view a different section of rows.
The following libraries will be visible:
* All libraries available on startup (session autoexec)
* Any libraries configured in the `services/public/[Data_Controller_Settings/settings]` Stored Process / Viya Job
* All libraries available to the logged in user in metadata (SAS 9 only)
Row and Column level security can also be applied in VIEW mode, as can additional table-level permissions (MPE_SECURITY table).
## Full Table Search
A single search box can be used to make a full table search on any character or numeric value, using this [macro](https://core.sasjs.io/mp__searchdata_8sas.html).
The search covers **every** column of the table at once, so you do not need to know which column holds the value you are looking for:
- **Character search** (the default) is a case sensitive CONTAINS match against every character column, so `Smith` finds `Smithson` and `smith` finds `Goldsmith`, but `smith` will not find `Smithson`.
- **Numeric search** (tick the Numeric box) is an exact match against every numeric column, so `42` will not find `420` or `4210`.
- If a filter is applied, the search runs within the filtered rows rather than the whole table.
- The grid is capped by the [`DC_MAXOBS_WEBVIEW`](/dcc-options/#dc_maxobs_webview) option (2,000 rows by default).
- For a search, the cap applies to the row count as well: a search that matches more rows than the cap returns 2,000 of them, and the count shown next to the table name is the number of rows returned, not the total number of matches.
- Without a search, the count shown next to the table name is the full number of rows in the filtered view, so it can be higher than the number of rows displayed - a table of 5,000 rows reports `5,000 rows` above a grid holding the first 2,000.
- A search that matches nothing shows a "No data found with given conditions" panel rather than an empty grid.
![Full table search](img/full-table-search.png)
<iframe width="560" height="315" src="https://www.youtube.com/embed/i27w-xq85WQ" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
## Options
This button shows a range of options. If the table is editable, you will also see a EDIT option.
### Download
The Download button gives several options for obtaining the current view of data:
1) CSV. This provides a comma delimited file.
2) Excel. This provides a tab delimited file.
3) SAS Datalines. This provides a SAS program with data as datalines, so that the data can be rebuilt as a SAS table.
4) SAS DDL. A download of a DDL file using SAS flavoured syntax.
5) TSQL DDL. A DDL download using SQL Server flavoured syntax.
6) Markdown. A pipe delimited markdown table, ready to paste into a wiki or a ticket.
7) PDF report. A report typeset by SAS: landscape A4, the dataset name as the title, the column headers repeated on every page, and a footer on every page carrying the filter, the user, the timestamp and the page number. SAS formats and labels are applied, so this shows formatted values rather than the stored values the grid displays. It is capped at the first 2,000 rows, and the footer says so when the cap is reached.
Note - if the table is registered in Data Controller as being TXTEMPORAL (SCD2) then the download option will prefilter for the _current_ records and removes the valid from / valid to variables. This makes the CSV suitable for DC file upload, if desired.
Note that all the above items are exported from backend. There is also a _frontend_ context menu that can be used in the VIEW screen (right click menu) for quick export into CSV or Excel formats.
### Web Query URL
This option gives you a URL that can be used to import data directly into third party tools such as Power BI or Microsoft Excel (as a "web query"). You can set up a filter, eg for a particular month, and refresh the query on demand using client tooling such as VBA.