Dynamic Charts

Use dynamic charts in Microsoft Excel or Microsoft PowerPoint to create charts in your output documents using Salesforce information.

For example, you could create a chart with custom color fields to differentiate the records on the Account object to create a dynamic range.

Create a range in Microsoft Excel

In order to use dynamic charts in your documents, you'll need to create a dynamic range with a column dedicated to labels and another column dedicated to values.

You can also use formulas in Excel to create dynamic ranges. This is useful when using Salesforce reports as your data source. For more information, see Merge Salesforce reports into a template.

Add a chart to Microsoft Excel

It is best practice to include your dynamic range in a Microsoft Excel sheet that is separate from your print sheet. You can hide the sheet that has the dynamic range and still update a chart at run time.

  1. To insert a chart, click the Insert tab, then click the Pie Chart symbol, and select the 3-D Pie chart.
  2. Once the chart is added to the Excel sheet, right click the inner box, and click Select Data.
  3. Assign your dynamic range as the data source for the page.
  4. Save the Microsoft Excel file and upload or replace the template into Salesforce. For more information, see Manage templates in DocGen Packages.
  5. Run the DocGen Package as normal and satisfy all the steps necessary. Below is the dynamic range returned in the output document.
  6. Below is the data source for the chart.

Dynamic charts for Microsoft PowerPoint

Using Microsoft Excel as middle-ware, you can dynamically create charts in your Microsoft PowerPoint document using data in Salesforce. All you need to do is create a dynamic range in Microsoft Excel and configure your DocGen Package properly.

In the following example, we will use information from custom fields added to a record on the Account object to create a dynamic range, but your dynamic range can utilize Salesforce Report data instead of Salesforce fields if needed.

Configure your Microsoft PowerPoint

First check to make sure that your Microsoft Excel sheet has been set up to with dynamic ranges for labels and values. For more information on how to set up dynamic ranges refer to Create a range in Microsoft Excel.

  1. Once you have configured your Microsoft Excel document, you must configure your Microsoft PowerPoint. Open your Microsoft PowerPoint document and insert a chart into a slide.

  2. After your chart is inserted into a Microsoft PowerPoint slide, navigate to your slide objects.

  3. There should be one object for your Microsoft PowerPoint chart within the objects list. Re-label your object with the same Microsoft Excel label you used when configuring your Microsoft Excel document.

Configure the DocGen Package

Once you have configured both your Microsoft Excel and Microsoft PowerPoint documents, be sure to include them in your DocGen Package. Your Microsoft Excel file should be included in the DocGen Package first and have a value of 0 in the Start Page and End Page.

The Microsoft PowerPoint file should come after your Microsoft Excel file.

Also, you need to include the Microsoft Excel file in your DocGen Package a second time within the Microsoft PowerPoint file.

  • You can do this by single-clicking the Microsoft PowerPoint file, then dragging and dropping the Microsoft Excel file to the far right grid in the select files section of the DocGen Package Detail Page.

Once the Microsoft Excel file is in the far right grid, insert the range label in the Sheet/Range column.

When you are ready to test your dynamic chart, navigate to a record on your starting object, click Generate Documents, satisfy all steps in the generate documents page and select Run.