Create a sub-report template for drill down to be used with the video "Creating Reports with Drill Down for an SQL Data Source".
Begin with a blank Microsoft Word document
Connecting to your data source
- Connect to the same data source as is used in your main template. The Northwind database is used in this example.
- Connect to your data source by going to AutoTag Manager->Data Sources->Add->then selecting your data source from the dropdown.
- Click OK.
- Click Close.
- Click Variables in the AutoTag Manager tab.
- You will be prompted to save, save the file as Product Sales Inner.
- Click Add.
- Name the variable “prod” (because this sub-report will be linked from the product name.)
- Set the Type to Text.
- For default, type “Chai”.
- Click Save.
Querying your data (Adding a Query Tag)
- Open the Tag Builder (Found in the AutoTag Designer tab.)
- Select Query.
- Click the Select Tab.
- Click Wizard.
- Click the line “click here to add a node.”
- Navigate to windward-studios/Products, select the node Product, and click OK.
- Click the line “click here to add a group.”
- Click the line “click here to enter a condition.”
- In the condition, select the subnode ProductName (underneath Product).
- Leave the condition as equal to.
- Click the dropdown for the value field and select the parameter prod.
- Click the line “click here to add an order by.”
- Select the subnode ProductName.
- Click OK to exit the wizard.
- Under nickname, type “[product].”
- Under var, type “prodInfo”
- Click Save tag.
Adding Information to your Sub-Report
- Type “Product Name: ”
- Click Tags, Out Tag (Found in the AutoTag Designer tab.)
- Expand the data tree and click the subnode ProductName under prodInfo.
- Type “We have ”
- Using the same method, add an out tag for UnitsInStock.
- Type “ units in stock and ”
- Using the same method, add an out tag for UnitsOnOrder.
- Type “ units on order. Price per unit is”
- Using the same method, add an out tag for UnitPrice.
- Double click the UnitPrice out tag (opens the Tag Builder.)
- Click the more button in the format field, and choose currency.
- Click OK.
- Click Save Tag.
- Save the inner file and close.