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

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Table of Contents

Intro

Icon

This is Part 3 of a 3-part tutorial series for the Employee Training scenario. It is recommended that you complete Part 1 - Importing Data and Part 2 - The Continue Modifier before starting this section.

Following the Sample

Icon

There is a downloadable PowerPointWriter_BasicTutorials.zip with completed templates and code. The completed example of the template is available under EmployeeTraining/templates/part3_template.pptx. The code for this part of the tutorial can be found in Part3.aspx.cs.

This part focuses on passing a presentation between PowerPointTemplate and PowerPointApplication in order to take advantage of the full range of features available with PowerPointWriter.

Adding to the Template

We will continue adding to our template from Part 2. The next part of our presentation will contain information about the Team the new employee will be working on.

  1. Add a new title slide to the presentation. Give it the title 'Your Team'.
  2. Place the data marker %%=Team.Name underneath the title. Our template slide is shown below.
    !Slide7Final.png!
    # Add a new content slide. Place the company logo in the bottom right corner.
  3. The title of this slide will be the data marker %%=Department.TrainingItem
  4. Create a new list in the body of the slide.
  5. Place the data marker %%=TrainingItems.Details as the first item in the list.
    !Slide8Final.Png!

This is the 8th and final slide in our template. This slide will be used as a template slide for 4 different data sets. To achieve this we will use the Slides.Copy method and the Slide data binding property.

Writing the Code

Following the Sample

Icon

There is a downloadable PowerPointWriter_BasicTutorials.zip with completed templates and code. The completed example of the template is available under ProjectProposal/templates/part3_template.pptx. The code for this part of the tutorial can be found in Part3.aspx.cs.

We will reuse the code from Part 1 and Part 2 of this tutorial. We will take out the Save call and add our new code for Part 3.

1. Pass the Template object to PowerPointApplication so that PowerPointApplication methods can be used.

2. We want to delete the last slide in our presentation, so we need to know how many slides there are. We can use Slides.Count to get this information.

3. Use the Slides.Delete method to delete the last slide. It takes an integer representing the index of the slide to delete as a parameter.

4. Save the final presentation and stream it in the response.

Final Code

Icon

For information on writing this code, see Part 1 - Getting Started.

Downloads

You can download the code for the Basic PowerPointWriter Tutorials as a Visual Studio solution, which includes the Project Proposal.

  • No labels