You want to build a Klip that uses a Microsoft Excel worksheet (.xls, .xlsx) as its data source.
Note: This article discusses advanced features that are only available in the licensed, commercial version of Klipfolio Dashboard.
In Klipfolio Dashboard version 5.2 and above, Klips can display data from an Excel workbook just like Klips that use XML orCSV data sources.
The general structure of Klips that display data from an Excel worksheet is the same as Klips that use other data sources. See Klip Development Fundamentals for details if this is your first time developing a Klip.
---------------- Important Notes ----------------
A sample Excel workbook used in this article can be downloaded. The screenshot below displays its content and the terminology used in the article:

1. Specify the following information about the worksheet using XML or JavaScript:
2. Write the <style> section that matches your data. Its format is the same whether you used XML or JavaScript to specify the content source.
If this is your first time developing an Excel Klip, it is recommended that you use the JavaScript template included in the Sample Excel Klip using JavaScript, as it provides you with ways to troubleshoot your Klip.
Here are some pros and cons of using XML and JavaScript to specify the data source:
XML:
JavaScript:
Specify the information about your Excel workbook in the <contentsource> block.
<contentsource> <excel> <file>C:\temp\example.xls</file> <sheet>2009</sheet> <range>B5:G12</range> </excel> </contentsource>
If the file is on your local drive, the file path would look like this:
<file>c:\folder1\example.xls</file>
Take a closer look at the Sample Excel Klip using XML by downloading it from klipfolio.com and opening it in a text editor such as Notepad.
To change the sample Klip to use your own file,
The following klipscript template opens a worksheet, converts it to XML, and passes it to Klipfolio Dashboard's data engine, which will then parse it using the <style> settings of the Klip.
<klipscript> <![CDATA[ // Don't forget to escape the backslashes var g_file = "C:\\temp\\example.xls"; function onRefresh() { // Open and get data from the worksheet. // Parameters are file, sheet and range. var excel = Engines.Excel.open (g_file, "2009", "B5:G12"); // Check if the Excel Engine was able to successfully convert the data to XML format. if (! excel.xml) { // If unsuccessful, output the lasterror into the Debug Window for further investigation. traceln ("EXCEL ERROR - > " + excel.lasterror); return false; } // Output the XML data as a reference when writing <style> settings. traceln ("EXCEL RESPONSE - >"); traceln (excel.xml); // Use Klipfolio Dashboard's Data Engine to parse the XML data using <style> settings. return Engines.Data.process (excel.xml); } ]]> </klipscript>
Take a closer look at the Sample Excel Klip using JavaScript by downloading it from klipfolio.com and opening it in a text editor such as Notepad.
To change the sample Klip to use your own file,
var excel = Engines.Excel.open (g_file, "2009", "B5:G12");
The stylesheet for Excel worksheet data must use Excel's alphabetical column headings. For example:
<style> C { type: number; itemcol: 1; label: "Q1"; format: "currency($)"; } D { type: number; itemcol: 2; label: "Q2"; format: "currency($)"; } ... row { type: item; definition: all; } </style>
Be sure to define row at the bottom of the <style> block to tell Klipfolio Dashboard that each row of data in the worksheet is an item.
For troubleshooting tips, see the how-to article Troubleshooting Excel Klips.