Generating Your Code So You Don’t Have To
You have put in the time, tweaked your template and gotten everything running smoothly in AutoTag. (Nice going!) But you need to ensure that your hard work is going to transition into your integration of the Windward Engine with ease.
The new Generate Code feature is here to help.
Introduced in Version 13.1, AutoTag’s Generate Code tool allows you to open an existing template and, with a click of a button, automatically create a window with the code needed to run your current template with all data sources and variables in your .NET or Java project.
The process is quick, shortens delivery time and helps alleviate any bumps in the road.
How the Generate Code Tool Works
The Windward Engine has eight major steps that you must define in your code in order to run a report. The Generate Code function takes care of these steps for you:
- Initializing the Engine. This process allocates the memory and sets up the basic structure.
- Opening input and output file streams. This creates the streams to your file path locations of your template (input) and generated final report (output).
- Creating a datasource connection. SQL data sources require a connection string with username, password, server and database. File-based data sources require a path to the datasource file.
- Instantiating the report object for desired output. You create an object using ReportXXXX(template, output), where XXXX is the file format you wish to create, i.e., DOCX, PDF, XLSX, etc.
- Running the report process. This step sets up the template with the defined data source and begins processing tags against each data source.
- Adding variable value mapping. This step assigns values to any variables defined in your template.
- Mapping data source nicknames. If you are using more than one data source, nicknames differentiate which data source a tag pulls its information from.
- Cleaning up.This last step closes out all file streams and releases the memory used back to the OS.
That is a LOT of steps if you just need to test your template. But AutoTag’s Generate Code function makes this process a breeze.
The tool shortens the above process by helping you create input and output file streams, set up connections to data sources, create variable value mapping, and assign nicknames to data sources — quickly and easily.
For details on how you can use Generate Code to please visit the Generate Code page in our documentation wiki.
Author: Ryan Fligg
Ryan, Windward's Sales Engineer, has been with Windward since 2006 in many roles as a sales engineer, IT specialist and account executive. Ryan's background fuels his desire to guide Windward's product development. He now works on the future vision of Windward offerings through creating the product roadmap, responding to customer requests, and communicating what Windward is doing and where it’s headed.
Other posts by Ryan Fligg