Page tree
Skip to end of metadata
Go to start of metadata

Description

This sample demonstrates how to extract data from an Excel file using ExcelWriter and import it to a PowerPoint presentation using PowerPointWriter.

 

The Data

Our Excel file contains employee data from the AdventureWorks database.

The Template

Our template presentation has a table with columns corresponding to the data in our Excel file.

The Code

The code below uses ExcelApplication to extract the data from the Excel spreadsheet into a DataTable. This code is also used in the ExcelWriter sample, Excel to DataTable Sample. It then passes the presentation to PowerPointTemplate and binds the data. The code uses MaxRowsPerSlide to ensure the data fits neatly in the presentation. See Fitting Data on to Multiple Slides for more information.

Result

The resulting output shows all the data from the Excel spreadsheet in a PowerPoint presentation table.

Downloads

data:Data.xlsx
template:template.pptx
output: output.pptx

  • No labels