Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

7. Call process to import the data into the template and save the file.

Code Block

pptt.Process();

//Stream the output in the response as an attachment

Code Block

pptt.Save(Page.Response, "Part1_Output.xlsx", false);

Final Code

Code Block
PowerPointTemplate pptt = new PowerPointTemplate();
pptt.Open(Page.MapPath("//templates//part1_template.pptx"));
DataBindingProperties dataProps = pptt.CreateDataBindingProperties();
object[] valuesArray = { "Project Name", "Project Date", "Review", "Leader Name", "Start Date", "Cost Estimate", "Project Summary" };
string[] columnNamesArray = {"Name", "Date", "ReviewStatus", "Leader", "Start", "Estimate", "Summary"};
pptt.BindData(valuesArray, columnNamesArray, "Proposal", dataProps);
pptt.Process();
pptt.Save(Page.Response, "Part1_Output.xlsx", false)

...