Document Solutions Data Viewer control.

Hierarchy

  • ReportViewer
    • DsDataViewer

Constructors

  • Document Solutions Data Viewer constructor.

    Parameters

    • element: string | HTMLElement

      root container element or selector pattern used to select the root container element.

    Returns DsDataViewer

Properties

LicenseKey: string

Product license key.

Example

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

Accessors

  • get toolbarLayout(): DataToolbarLayout
  • Get the current toolbar layout information.

    Returns DataToolbarLayout

    Example

    viewer.toolbarLayout
    
  • set toolbarLayout(buttons): void
  • Sets the toolbar layout information and modify layout.

    Parameters

    Returns void

    Example

    viewer.toolbarLayout = { default: ['open', 'zoom', 'fullscreen', 'theme-change'] }
    
  • get sidebarLayout(): string[]
  • Get the current sidebar layout information.

    Returns string[]

    Example

    viewer.sidebarLayout
    
  • set sidebarLayout(sidebarLayout): void
  • Sets the sidebar layout information and modify layout. Currently supported: SearchPanel.

    Parameters

    • sidebarLayout: string[]

    Returns void

    Example

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

Methods

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

    Parameters

    • selector: string | HTMLElement

    Returns undefined | DsDataViewer

    Example

    var viewer = DsDataViewer.findControl("#root");
    
  • Use this method to close and release resources occupied by the DsDataViewer.

    Returns void

  • Open data file.

    Parameters

    Returns Promise<any>

    Example

    viewer.openFile("Documents/HelloWorld.xlsx", FileType.XLSX, {loadHiddenSheets: true});
    
  • Fetches the specified sheet based on the index.

    Parameters

    • index: number

      The index of the sheet to return.

    Returns WorkSheet

    The specified sheet.

    Example

    viewer.getSheet(0)
    
  • Fetches the sheet with the specified name.

    Parameters

    • name: string

      The sheet name.

    Returns WorkSheet

    The sheet with the specified name.

    Example

    viewer.getSheetFromName("Sheet1")
    
  • Fetches the active sheet.

    Returns WorkSheet

    The active sheet instance.

    Example

    viewer.getActiveSheet()
    
  • Set the visibility of the sidebar.

    Parameters

    • show: boolean

      The visibility of the sidebar.

    Returns void

    Example

    viewer.showSidebar(true)