Spotfire 15.0 Web Player JavaScript API Reference
    Preparing search index...

    Interface Document

    Contains document related functionality. The document is created by calling the Application.openDocument function. The document is not ready to be used until the onOpened is raised. API methods called before this event will be queued and executed once the document is ready.

    interface Document {
        data: Data;
        elementId: string;
        filtering: Filtering;
        isLoaded: boolean;
        marking: Marking;
        applyBookmark(bookmarkName: string): void;
        applyBookmarkById(id: string): void;
        close(): void;
        downloadAsDxp(): void;
        executeCustomExportTool(fullToolName: string): void;
        executeCustomTool(fullToolName: string): void;
        exportActiveVisualAsImage(width: number, height: number): void;
        exportReport(reportName: string): void;
        exportToPdf(): void;
        exportToPowerPoint(): void;
        getActivePage(callback: OnGetActivePage): void;
        getBookmarkNames(callback: OnGetBookmarkNames): void;
        getBookmarks(callback: OnGetBookmarks): void;
        getDocumentMetadata(callback: OnGetDocumentMetadata): void;
        getDocumentProperties(callback: OnGetProperties): void;
        getDocumentProperty(propertyName: string, callback: OnGetProperty): void;
        getDocumentState(callback: OnGetDocumentState): void;
        getPages(callback: OnGetPages): void;
        getReports(callback: OnGetReports): void;
        logout(showConfirmation: boolean): void;
        onActivePageChanged(callback: OnActivePageChanged): void;
        onDocumentMetadataChanged(callback: OnGetDocumentMetadata): void;
        onDocumentPropertyChanged(
            propertyName: string,
            callback: OnGetProperty,
        ): void;
        onDocumentReady(callback: OnDocumentReady): void;
        onDocumentStateChanged(callback: OnGetDocumentState): void;
        print(): void;
        setActivePage(pageIndexOrTitle: string | number): void;
        setDocumentProperty(propertyName: string, propertyValue: any): void;
    }
    Index

    Properties

    data: Data

    Reference to the data object.

    elementId: string

    The name of the DOM element that contains the Spotfire document.

    filtering: Filtering

    Reference to the Filtering object.

    isLoaded: boolean

    Returns a value indicating whether the document is loaded. When this value is false it is not possible to use any API methods on the document instance.

    marking: Marking

    Reference to the Marking object.

    Methods

    • Applies a bookmark by its name. The onError event will be raised if the bookmarks does not exist or if several bookmark have the name.

      Parameters

      • bookmarkName: string

        The bookmark name.

      Returns void

      Use Document.applyBookmarkById from API version 3.3 and forward.

    • Applies a bookmark by its id. The onError event will be raised if the bookmarks does not exist.

      Parameters

      • id: string

        The identifier of the bookmark to apply.

      Returns void

      3.3

    • Close the document. The onClosed callback will be called for the document. Note that there may be other open document instances for the application.

      Returns void

      7.5

    • Download the analysis as a dxp file.

      Returns void

      7.5

    • Execute a custom export tool.

      Parameters

      • fullToolName: string

        The full name of the export tool to execute, including namespace (e.g. "MyCompany.Spotfire.CustomTools.MyTool").

      Returns void

      7.5

    • Execute a custom tool.

      Parameters

      • fullToolName: string

        The full name of the tool to execute, including namespace (e.g. "MyCompany.Spotfire.CustomTools.MyTool").

      Returns void

      7.5

    • Export active visualization image.

      Parameters

      • width: number

        The width of the exported image. Default value is 800px.

      • height: number

        The height of the exported image. Default value is 600px.

      Returns void

      7.5

    • Exports the report specified by name to PDF.

      Parameters

      • reportName: string

        The report name to export.

      Returns void

      7.12

    • Launch the export to Pdf dialog.

      Returns void

      7.5

    • Launch the export to PowerPoint dialog.

      Returns void

      7.5

    • Get the names of the bookmarks in the document.

      Parameters

      Returns void

      3.1

    • Get the bookmarks in the document.

      Parameters

      Returns void

      3.3

    • Get a list of all the properties in the document.

      Parameters

      Returns void

      3.1

    • Get the information about the property with given name.

      Parameters

      • propertyName: string

        The name of the property.

      • callback: OnGetProperty

        The callback function.

      Returns void

      3.1

    • Gets all pages in the opened analysis.

      Parameters

      Returns void

      3.1

    • Gets the name of the reports in the analysis.

      Parameters

      Returns void

      7.12

    • Logout the user

      Parameters

      • showConfirmation: boolean

        If True, a confirmation dialog will be presented to the user.

      Returns void

      7.5

    • Register a callback function that will be called when a page change occurs in the analysis.

      Parameters

      Returns void

    • Register a callback function that will be called when the metadata for the document changes.

      Parameters

      Returns void

      11.3

    • Register a callback function that will be called when a given property has changed value.

      Parameters

      • propertyName: string

        The name of the property to monitor.

      • callback: OnGetProperty

        The callback function.

      Returns void

      3.1

    • Register a callback function that will be called when the document is ready.

      Parameters

      Returns void

    • Register a callback function that will be called when the document state changes.

      Parameters

      Returns void

      11.3

    • Launch the print dialog.

      Returns void

      7.5

    • Change the active page by page title or page index. The onError event will be raised if the page does not exist.

      Parameters

      • pageIndexOrTitle: string | number

        Page index (0 based) or page title.

      Returns void

    • Set the value of an existing property.

      Parameters

      • propertyName: string

        The name of the property.

      • propertyValue: any

        The value of the property as a formatted string or an array of formatted strings, in the users locale.

      Returns void

      3.1