[]
Document Solutions Data Viewer - v8.0.0 / DsDataViewer
Document Solutions Data Viewer control.
ReportViewer
↳ DsDataViewer
• new DsDataViewer(element
)
Document Solutions Data Viewer constructor.
Name | Type | Description |
---|---|---|
element |
string | HTMLElement |
root container element or selector pattern used to select the root container element. |
ReportViewer.constructor
▪ Static
LicenseKey: string
Product license key.
Example
<script>
// Add your license
DsDataViewer.LicenseKey = 'XXX';
// Add your code
const viewer = new DsDataViewer("#viewer");
</script>
• get
toolbarLayout(): DataToolbarLayout
Get the current toolbar layout information.
Example
viewer.toolbarLayout
• set
toolbarLayout(buttons
): void
Sets the toolbar layout information and modify layout.
Name | Type |
---|---|
buttons |
DataToolbarLayout |
void
Example
viewer.toolbarLayout = { default: ['open', 'zoom', 'fullscreen', 'theme-change'] }
• get
sidebarLayout(): string
[]
Get the current sidebar layout information.
string
[]
Example
viewer.sidebarLayout
• set
sidebarLayout(sidebarLayout
): void
Sets the sidebar layout information and modify layout. Currently supported: SearchPanel.
Name | Type |
---|---|
sidebarLayout |
string [] |
void
Example
// Open SearchPanel
viewer.sidebarLayout = ['SearchPanel'];
// Clear all sidebars
viewer.sidebarLayout = [''];
// Default sidebar layout
viewer.sidebarLayout = [];
▸ Static
findControl(selector
): undefined
| DsDataViewer
Gets the viewer instance using the host element or host element selector
Name | Type |
---|---|
selector |
string | HTMLElement |
undefined
| DsDataViewer
Example
var viewer = DsDataViewer.findControl("#root");
▸ dispose(): void
Use this method to close and release resources occupied by the DsDataViewer.
void
ReportViewer.dispose
▸ openFile(file
, fileType
, openOptions?
): Promise
<any
>
Open data file.
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. |
Promise
<any
>
Example
viewer.openFile("Documents/HelloWorld.xlsx", FileType.XLSX, {loadHiddenSheets: true});
▸ getSheet(index
): WorkSheet
Fetches the specified sheet based on the index.
Name | Type | Description |
---|---|---|
index |
number |
The index of the sheet to return. |
The specified sheet.
Example
viewer.getSheet(0)
▸ getSheetFromName(name
): WorkSheet
Fetches the sheet with the specified name.
Name | Type | Description |
---|---|---|
name |
string |
The sheet name. |
The sheet with the specified name.
Example
viewer.getSheetFromName("Sheet1")
▸ getActiveSheet(): WorkSheet
Fetches the active sheet.
The active sheet instance.
Example
viewer.getActiveSheet()
▸ showSidebar(show
): void
Set the visibility of the sidebar.
Name | Type | Description |
---|---|---|
show |
boolean |
The visibility of the sidebar. |
void
Example
viewer.showSidebar(true)