Skip to main content

Using Tags in Microsoft Excel


After completing this tutorial you will have learned how to work with basic Windward tags via the Tag Builder. 


The Tag Builder lets us create a table from scratch. While we won't cover all the features here, this will give you a peek at the Tag Builder's capabilities.

Note: This tutorial covers both XML and SQL data sources, and the examples shown here use the sample data source Northwind. You can "play along" with this tutorial by using the Northwind XML file that ships with AutoTag. Or, you can follow these steps with your organization's own data sources, keeping in mind that your specific choices (data source location, server name, database name, data groups, etc.) will be different from what's listed here.


Create a table in Excel

Before we can begin placing tags in the template, we need to know where they will go. As we did in the Data Bin example, we'll be creating a table of employees. This one will have columns for the employee ID, the employee last name, the employee first name, and an additional column, job title.

Choose eight cells in Excel to create a 4 by 2 table. We chose this size because it gives us one column for each data category. In the first row we will place the data titles, and in the second row we will place the tags. You do not need to know how many rows of data will be output when you run the report; AutoTag takes care of expanding that for you automatically. Note: We recommend you not use the table command in Excel, and instead use cells only for table construction. 

In the table's first row enter the column headings, and then format the table using Excel's commands:



Open the Tag Builder

Click the first cell in the second row of the table and click the Tag Builder icon in AutoTag:



This opens the Tag Editor (which is the same window that appears when you highlight an existing tag and click the Edit Tag icon):



Create a ForEach tag

In the Tag Editor, click the Tags tab:




Click the <ForEach> Tag icon.

Set the tag's properties

Click the Select tab. Here is where you will set the characteristics of the tag.

First, we must choose what data will be called upon by the <ForEach> tag. Since we'll be creating a table of data from subgroups of the Employees data group, that's the group we want to loop through.  Click the Employees data group in the Data Source pane, and drag and drop that group into the Select Bar.

Second, we must name the <ForEach>tag, because if we don't, we cannot save it. We'll call this tag "EmployeeList." In the Attributes pane, click the Var text box, and type the desired name (EmployeeList) in the text box:



We could also define other characteristics of the tag now -- there are many options to choose from -- but we will keep it basic in this introductory tutorial and stop here.

Evaluate the data

Next, we want to make sure that we've chosen the correct set of data to work with. Click the Evaluate button. In the Evaluate Output pane, we see all the data in the group:



Save the tag

Click the Save Tag icon. This closes the Tag Editor and places our first ForEach tag in the table:



Create an out tag

Now it's time to place data subgroups into the individual cells. Click in the cell that holds the <ForEach> tag, and click the Tag Builder icon. A prompt appears, asking you where you'd like to place the tag:



Place your pointer just after the colon (:) and click. The Tag Builder window opens.

Follow the same general procedure as you did with the <ForEach> tag, with a few changes:

  1.  Click the Tags tab and click the <Out> Tag icon. (Note: the <out> tag is the default tag type, so typically this is already done for you.)

  2. Click the Select tab.

  3. In the Data Source pane, click the + sign next to the <ForEach> tag name that you created in step four – in this case, EmployeeList – to expand it.

  4. Drag the EmployeeID data subgroup from the EmployeeList into the Select Bar. Note: Be sure to drag and drop the correct EmployeeID data subgroup, as there are two listed in the Data Source Pane. Drag and drop the data subgroup from the EmployeeList, not from the main data source listed below it.

  5. Optional step: In the Nickname text box in the Attributes pane, type the name of the tag as you would like it to appear in the template. If you do not enter a nickname, AutoTag assigns a default name based on the information in the Select Bar. If you do enter a nickname, we strongly recommend you include angle brackets around the text, so that anyone viewing the template can tell at a glance what is a tag and what is simply text.

  6. Evaluate the data by clicking the Evaluate button.

  7. Save the tag.

Create more out tags

Using the same procedures that you followed in step seven, create <out> tags for the three remaining cells. Of course, each remaining tag will be in its own cell, so you will not see a prompt asking you where to insert the tag.

Close the <ForEach> loop

Now that we have all our tags placed in the table, we must close the <ForEach> loop. Click the template just below the table and click the Tag Builder icon. Click the Tags tab, and click the <End ForEach> Tag icon. Click the Save Tag icon. Your template now has all the necessary tags in place:



Save and run the report

Save your report template using Excel's Save command. Then, from the AutoTag Run Output button, click the desired report format icon. In this example, we chose to view the report as a PDF file, and this is the result:



Congratulations!  You may need to tweak your table dimensions a bit, as Excel does not let you auto-expand a cell as needed, but you've now mastered the basics of creating tags. For help with complex tag creation and editing, please see our other tutorials.

  • Was this article helpful?