Skip to content

Commit

Permalink
update va-report-components v2.4.0 doc and changelog (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
brmorr authored Nov 16, 2023
1 parent 6096d8c commit 28375cc
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sdk/va-report-components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 2.4.0 (November 16, 2023)

### Added
- SAS Viya 2023.11 support (Report Package version 40)
- `getData` method on `ObjectHandle`

## 2.3.0 (October 19, 2023)

### Added
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
---
id: version-2.4.0-ObjectHandle
title: ObjectHandle
original_id: ObjectHandle
---

An `ObjectHandle` is used to perform actions on a single object in an open
report. An object's handle can be obtained using the `getObjectHandle` method
on a [`ReportHandle`](ReportHandle.md).

When a report element is assigned new attribute values or removed from the DOM,
any `ObjectHandles` obtained from that element are invalidated and should be
discarded.

## Methods

### exportData(format: string, options?: ExportDataOptions): Promise\<string>
Exports a file that contains the object's data, and returns a URL to the file.

`format` defines the format of the data output file.
Supported formats:
- `"XLSX"`
- `"CSV"`
- `"TSV"`

`options` is an [`ExportDataOptions`](ExportDataOptions.md) bundle that modifies properties of the exported data file.

If no `options` parameter is supplied, the data will be exported using the default option values.

### exportPDF(options?: ExportPDFOptions): Promise\<string>

Exports a PDF of the report object and returns a URL to the PDF document.

`options` is an [`ExportPDFOptions`](ExportPDFOptions.md) that controls the format of the exported PDF document. The option `includedReportObjects` does not apply when exporting a report object.

If no `options` parameter is supplied, the report is exported using the default options values.

### refreshData(): void

Refreshes the data for the report object that is controlled by the
`ObjectHandle`.

### getData(options?: Object): ReportObjectResultData[]

Returns all of the data from the report object. This data matches what appears in the report object, including any filters that have been applied.

#### Arguments

`options` is an optional options bundle for customizing the returned data. The following options are supported:

- `formatData` specifies the format of the returned data.
- `true` returns all formatted data.
- `false` returns all unformatted data.
- `"datesOnly"` `default` returns SAS date values as formatted data and returns all other values as unformatted data.

#### Return value

Returns an array of [`ReportObjectResultData`](ReportObjectResultData.md) objects, where each object is associated with one data set.

### getSelectedData(options?: Object): ReportObjectResultData[]

Returns a user's selection data from the report object. Returns an empty array if the object has no selections.

#### Arguments

`options` is an optional options bundle for customizing the returned data. The following options are supported:

- `formatData` specifies the format of the returned data.
- `true` returns all formatted data.
- `false` returns all unformatted data.
- `"datesOnly"` `default` returns SAS date values as formatted data and returns all other values as unformatted data.

#### Return value

Returns an array of [`ReportObjectResultData`](ReportObjectResultData.md) objects, where each object is associated with one data set.

For user selection data, the ReportObjectResultData property `columns` will never include values for `usage`, `aggregation`, or `format`.

### addEventListener(eventType: string, listener: (event: Object) => void)

Adds an event listener to the `ObjectHandle` to call the supplied listener when the specified event occurs.

#### Arguments

`eventType` is a string that represents the event type to listen for. These event types are supported:
- `"selectionChanged"` for listening for selection changes in the object.

`listener` is an event listener callback function. When the event occurs, `listener` is called and passed an event object containing the following properties:
- `type` is a string that matches the event type.
- `target` refers to the ObjectHandle that the event occurred on.

### removeEventListener(eventType: string, listener: (event: Object) => void)

Removes the previously registered event listener from the `ObjectHandle`.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[
"2.4.0",
"2.3.0",
"2.2.0",
"2.1.0",
Expand Down

0 comments on commit 28375cc

Please sign in to comment.