To correctly format numerical data in AutoTag-generated documents.
For the starting template, we created labels for a Date, Unit Price and Quantity as shown in the picture below, however this tutorial is perfectly doable without this.
Load the MSSQL datasource by clicking the bottom half of the "Data Sources" button, and selecting MSSQL. If there is no MSSQL option in the drop down menu, you may select another datasource, or follow the instructions in the "Creating a SQL datasource" tutorial.
Insert an Out tag, and select the OrderDate row from the "Invoices" View. Notice that when you hover over "OrderDate" a small hint appears that says "DateTime." This is the type of data stored in that field.
Now insert another out tag for the Unit Price. Bind it to Views > Invoices > UnitPrice. Notice the hint says "Currency" this time.
Insert an out tag and bind it to Views > Invoices > Quantity. This time the hint just says "Int16" which indicates Quantity is just a plain 16-bit integer. We only care that it isn't a currency, date or some other number requiring formatting.
Click Output > DOCX to view the report. Notice that the Date has a rather unusual format. This format would look great in some cases, but we only have a month, day and year provided so the time stamp is unnecessary. Also notice that the unit price is simply displayed as "14" It would look better if it looked like this: "$14.00"
Format the date by selecting its respective tag and then clicking the "Format Data" button on the right side of the AutoTag ribbon. Select "Date" as the category, then select a type. In the video below, we selected "03/14/01" but feel free to select any of them.
We also want to format the Unit Price to display as a currency. Follow the same procedure as the previous step, but select "Currency" as the category. The default settings should be fine but feel free to play with them.
You may also want to display the quantity in a decimal form rather than a plain integer. For example, if you charge for a service by the hour and want to print an invoice showing the exact amount of time spent on a service, you may want to show the quantity with 2 decimal places. Do this by selecting "Number" in the Format Data window, then adjust the settings as you see fit.
Generate the final document and see the results.
You have completed this tutorial. We recommend taking a look at the Out Tag - Displaying Images tutorial next!