Create an asset tracker solution using InfoPath and Excel
Author: mety Labels:: Create an asset tracker solution using InfoPath and ExcelMicrosoft Office InfoPath lets you create form templates for data entry and collection. Microsoft Office Excel 2007 enables users to calculate, chart, and analyze data. By using both of these programs and XML, you can easily create a simple but effective, no-code business solution for tracking assets in a company. Introduction to creating an Asset Tracker solutionYou can exchange XML data between InfoPath and Excel. Although the Infopath Export command is a simple, straightforward way to send form data to Excel, there's another approach you can take which gives you much more flexibility. By explicitly mapping the InfoPath XML schema file (.xsd) in Excel, and then importing InfoPath form files (.xml) into Excel, you can customize the layout of your data and better leverage the features in Excel to help you manage and analyze your data more efficiently.In this article, we will use the InfoPath Asset Tracker sample form template to illustrate how you can make InfoPath, XML, and Excel work together. Imagine that each year, your organization inventories assets in each employee's office. Then, an Excel report is run to help decide how to allocate the equipment budget for next year. The following diagram is an overview of how you can gather, track, and report asset data in your department. The Asset Tracker form template is created. The schema file is mapped to an Excel table and the table layout is customized. A blank PivotTable and PivotChart summary report is created. The Asset Tracker form is used to collect data from users. All form data is exported into the Excel table and the PivotTable and PivotChart reports are refreshed. This solution involves the following user roles and products: = Required = Not required
Step 1: Customize the Asset Tracker form templateThe Asset Tracker form template, which is included in InfoPath, enables you to gather information about each asset in an employee's office, the department that the employee belongs to, categories of assets, and details about each asset. In this solution, a form designer submits the form template to the decision-maker's e-mail account by using Office Outlook 2007. Task 1: Open and customize the Asset Tracker form templateBecause you cannot publish a form template to a list of e-mail recipients if it has a rich text box control containing linked images, you need to make a small change to the Asset Tracker sample template form.
Task 2: Define the Submit optionsThe next task is to define the Submit options so that the employees can submit a uniquely named form file (.xml) to the decision-maker's e-mail account as an attached file.
Step 2: Map the schema file and customize the table layout in ExcelSetting up the connection between InfoPath and Excel requires three tasks: extracting the schema file for the Asset Tracker form template, mapping this schema file in Excel, and customizing the default layout of the Excel table that will contain all the imported XML form data files. Task 1: Extract the schema file from InfoPath
Note the location of the folder where all of the source files are saved and the name of the schema file, in this case, myschema.xsd, which contains the schema definition of the form XML data. Task 2: Map the InfoPath schema file in Excel
Task 3: Customize the layout of the Excel tableBy default, Excel uses the XML element names as column headings for the table. However, you can change the column headings by editing the column header cells.
Step 3: Create a PivotTable and PivotChart summary reportDecision-makers use PivotTable and PivotChart reports to analyze, explore, and visualize summary data. By setting up the PivotTable and PivotChart reports you want to use in this scenario ahead of time, it will be a simple operation for a decision-maker to run the report with the completed data later.
Step 4: Collect asset information from usersNow, that the form template is ready to be filled out by all of the employees, you need to publish the form and send it to each employee. When each employee submits the completed form, it is sent as an XML data file (.xml) attached in an e-mail message to the decision-maker's e-mail account. The decision-maker can then move all of the messages to a dedicated InfoPath folder in Outlook. In this scenario, it is recommended that you assign a specific time-period for all users to complete the forms so that the decision-maker can run the report with all the completed forms when the data-gathering deadline has been reached.
In Outlook, the decision-maker can organize all of the submitted XML forms in one of two ways:
Step 5: Import forms into ExcelBecause you already created the Excel workbook steps 2 and 3, it's a simple matter for the decision maker to export and review the form data. The decision maker simply needs to export the xml files (.xml) from Outlook, import all of the form files (.xml) into the Excel workbook, and then refreshing the data. Task 1: Export the forms from Outlook to a Windows folder
Task 2: Import the forms into Excel
By default, Excel overwrites any existing data in the mapped cells, which is the desired final outcome for this business solution. However, a decision-maker could, for example, import the data several times to gauge progress before the scheduled deadline. Note In Excel, you can also append the data by using the Append new data to existing XML tables option (on the Developer tab, in the XML group, click Map Properties), which may be appropriate for other solutions. For more information, see the Excel help topics, Import XML data and Append or overwrite mapped XML data. Task 3: Refresh the PivotTable and PivotChart reports
The Excel workbook now contains all of the data and summary reports that you need to help you allocate the equipment budget for next year. Of course, you can do further analysis in your Excel workbook if necessary, such as sorting, filtering, or conditionally formatting the data. Final thoughts: Consider using a SharePoint list or Access databaseAs an alternative, consider using a SharePoint list or Access database, instead of XML, to transfer data between InfoPath and Excel. Use a SharePoint ListFrom InfoPath, you can easily use a SharePoint list as a read-only data source. You can do one of two things:
Once a data connection is created, you can refresh the data in Excel to retrieve up-to-date data. You can use a SharePoint list to add and update the data, use an InfoPath form to display an item from the list (for example, a complex or long item best displayed vertically), and then use Excel to further analyze the data. Display a single item for easy review in InfoPath. Add and update data in a SharePoint List. Refresh and report up-to-date with Excel. For more information, see Add a data connection to a SharePoint document library or list and Import data from a SharePoint list. Use an Access databaseFrom InfoPath, you can create a read/write connection to an Access database. From Excel, you can explicitly create a data connection to the Access database that you can refresh to retrieve up-to-date data. You can even define the connection to automatically refresh when the workbook is opened, or periodically refresh, such as every 5 minutes. You can use an Access database as an intermediary between InfoPath and Excel. When you submit an InfoPath form to Access, you update the Access database. When you refresh the data connection in Excel, you retrieve updated data from Access. In effect, you are submitting data indirectly from InfoPath to an Excel workbook. Display and submit a form to an Access database. Store data in an Access database. Refresh and report up-to-date with Excel. For more information, see Design a form template that is based on a Microsoft Access database. Tip Did you know that you can create an InfoPath form directly from Access 2007? If your users have Outlook 2007 and InfoPath 2007 installed on their computers, you can gather data from diverse users directly from Access 2007 by using the Collect data from e-mail messages wizard. For more information, see the Acess 2007 help topic, Collect data by using e-mail messages. |