Previous Topic: Defining Results ScriptNext Topic: Built-In Functions


Toolbar Button to Show Excel Spreadsheet

To create a toolbar button to invoke the Web component, add a <tool> element. The example below creates a 'Show Excel View' button to display search results in a spreadsheet:

<results>
...
  <tool 
        name="excel"
        tooltip="Show Excel View"
        icon="excel.gif" 
        function="ShowExcel" />
  <script>
        <![CDATA[
                <script type="text/javascript" 
                        src="scripts/show-excel.js">
                </script>
        ]]>
  </script>
<results>

This calls the function SE_ShowExcel() provided in the show-excel.js library.

The SE_ShowExcel() function loads data into the component, displays the component and hides the results table. That is, it loads search results into a spreadsheet and displays the spreadsheet, and hides the standard table of search results.