[]
        
(Showing Draft Content)

DsDataViewer

Document Solutions Data Viewer - v7.2.0 / DsDataViewer

Class: DsDataViewer

Document Solutions Data Viewer control.

Hierarchy

  • ReportViewer

    DsDataViewer

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new DsDataViewer(element)

Document Solutions Data Viewer constructor.

Parameters

Name Type Description
element string | HTMLElement root container element or selector pattern used to select the root container element.

Overrides

ReportViewer.constructor

Properties

LicenseKey

Static LicenseKey: string

Product license key.

Example

<script>
 // Add your license
 DsDataViewer.LicenseKey = 'XXX';
 // Add your code
 const viewer = new DsDataViewer("#viewer");
</script>

Accessors

toolbarLayout

get toolbarLayout(): DataToolbarLayout

Get the current toolbar layout information.

Example

viewer.toolbarLayout

Returns

DataToolbarLayout

set toolbarLayout(buttons): void

Sets the toolbar layout information and modify layout.

Example

viewer.toolbarLayout = { default: ['open', 'zoom', 'fullscreen', 'theme-change'] }

Parameters

Name Type
buttons DataToolbarLayout

Returns

void


sidebarLayout

get sidebarLayout(): string[]

Get the current sidebar layout information.

Example

viewer.sidebarLayout

Returns

string[]

set sidebarLayout(sidebarLayout): void

Sets the sidebar layout information and modify layout. Currently supported: SearchPanel.

Example

// Open SearchPanel
viewer.sidebarLayout = ['SearchPanel'];
// Clear all sidebars
viewer.sidebarLayout = [''];
// Default sidebar layout
viewer.sidebarLayout = [];

Parameters

Name Type
sidebarLayout string[]

Returns

void

Methods

findControl

Static findControl(selector): undefined | DsDataViewer

Gets the viewer instance using the host element or host element selector

Example

var viewer = DsDataViewer.findControl("#root");

Parameters

Name Type
selector string | HTMLElement

Returns

undefined | DsDataViewer


dispose

dispose(): void

Use this method to close and release resources occupied by the DsDataViewer.

Returns

void

Overrides

ReportViewer.dispose


openFile

openFile(file, fileType, openOptions?): Promise<any>

Open data file.

Example

viewer.openFile("Documents/HelloWorld.xlsx", FileType.XLSX, {loadHiddenSheets: true});

Parameters

Name Type Description
file string | Blob | URL The data file.
fileType FileType The type of the imported data file.
openOptions? XlsxOpenOptions | SSJsonOpenOptions | CsvOpenOptions | SjsOpenOptions The options for imported data file.

Returns

Promise<any>


getSheet

getSheet(index): WorkSheet

Fetches the specified sheet based on the index.

Example

viewer.getSheet(0)

Parameters

Name Type Description
index number The index of the sheet to return.

Returns

WorkSheet

The specified sheet.


getSheetFromName

getSheetFromName(name): WorkSheet

Fetches the sheet with the specified name.

Example

viewer.getSheetFromName("Sheet1")

Parameters

Name Type Description
name string The sheet name.

Returns

WorkSheet

The sheet with the specified name.


getActiveSheet

getActiveSheet(): WorkSheet

Fetches the active sheet.

Example

viewer.getActiveSheet()

Returns

WorkSheet

The active sheet instance.


showSidebar

showSidebar(show): void

Set the visibility of the sidebar.

Example

viewer.showSidebar(true)

Parameters

Name Type Description
show boolean The visibility of the sidebar.

Returns

void