Page tree

Versions Compared

Key

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

...

6. Call PowerPointTemplate.BindData() to bind the data to the data marker. The data source name should match the value in your data marker.

Csharp
6
6
{vbnet:6}
PPTT.BindData(values, colnames, "DataSource1", DataProps);

...

Csharp
9
9
using SoftArtisans.OfficeWriter.PowerPointWriter;
...
PowerPointTemplate PPTT = new PowerPointTemplate();
PPTT.Open(Page.MapPath("Hello World.pptx"));
DataBindingProperties DataProps = PPTT.CreateDataBindingProperties();
string value = DataValueBox.Text.Trim();
string[] values = { value };
string[] colNames = { "DataValue" };
PPTT.BindData(values, colNames, "DataSource1", DataProps);
PPTT.Process();
PPTT.Save(Page.Response, "Output.pptx", false);

Downloads

You can download the code for the hello world tutorial as a Visual Studio solution.

...