How to Export Results to Microsoft® Excel

Before continuing, familiarize yourself with the information in the topic How to Customize Your SmartHub User Interface.

The Export To Excel component lets users export results to an XLSX file.

The Export To Excel component comes in the following pages by default:

  • Index.html
  • Results.html

If you want to use the Export To Excel component in your custom page you have to add the following code to your page:

Copy
<div class="CoveoExportToExcel"></div>

How to Configure the Export To Excel Component

Available settings for this component include the following:


  • data-batch-size: The maximum number of results your backend can return.
    • Default Value: 500


  • data-template-path: Path to your excel template.
    • Default Value: "~/Templates/ExportToExcelTemplate.xlsx"


  • data-property-mappings: Properties and their pretty names wanted for the columns.
    • Default Value: "title,Title;author,Author;excerpt,Summary;filetype,Result Type;date,Last Modified Time;ContentSource,Content Source;clickUri,Document Path;Size,File Size(in bytes)"


  • data-start-cell: The cell you want to start writing from.

  • Default Value: A1

Copy
<div class="CoveoExportToExcel" data-number-of-results="500" 
data-batch-size="500"data-template-path="~/Templates/ExportToExcelTemplate.xlsx"
data-start-call="A1"
data-property-mappings="title,Title; author,Author;excerpt,Summary;filetype,Result Type;date,Last Modified
Time;ContentSource,Content Source;clickUri,Document Path;Size,File Size(in bytes)"><div>