21. Introduction to automation

think-cell helps you to quickly create professional, data-driven charts in PowerPoint. But what about automating periodic reports, or using a web service to create charts based on your parameters, or exporting your business intelligence reports as PowerPoint slides? Using think-cell’s automation, you can do this quickly with your Excel or JSON data, and without the mistakes commonly found in a manual process. All you need is:

1.
A PowerPoint presentation with think-cell charts.
2.
Programmatic logic to control the automation.

Let’s begin by creating a PowerPoint presentation with a think-cell chart as an automation template:

1.
Create a chart in PowerPoint as described in Introduction to charting and later chapters. Any think-cell chart type will work, including all decorations like axes and difference arrows. think-cell template chart for automation with no name

The initial data is not important as it will later be replaced programmatically by the real data.

2.
In the contextual toolbar of the chart, click on the field that says UpdateChart Name.
3.
Enter a unique name, e.g., Chart1, which you will refer to later think-cell template chart for automation with name
4.
Save the presentation, e.g., as template.pptx.

The next step is to create programmatic logic which will merge your Excel or JSON data with the chart.

With the process above you can create presentations with arbitrary combinations of think-cell charts. You can prepare a library of all the chart types you need and, as required, versions with different chart decorations enabled. Then, you can freely combine these templates and supply them with data for use in a new presentation using either Excel or JSON.

Note: This approach replaces the need for a general API to create charts and add chart decorations, which is not supported.