Closing the gap between engaging report designs and automated delivery of personalized information is not trivial. Given the right tools and a structured approach, things do become manageable. The benefits of such efforts are substantial. Getting the right information delivered at the right time packaged as a captivating data story, makes all the difference between actionable knowledge and data lost in the information overload we all deal with on a daily basis.
In what follows Datylon Report Studio and Datylon Report Server are used to set up a simple yet ‘realistic’ and fully functional report automation scenario. The report was designed using Datylon for Illustrator and uploaded as templates to Datylon Report Studio. The look & feel of the templates can be changed at any time, without needing to edit anything in the scripts. The creative process, while crucial for an impactful end-to-end report delivery flow, is not further discussed here.
The complete script is available in a public bitbucket repo.
The README information stored in the repository should give you enough information to run the report renderings and play around with it.
The (fictive) example data from which the report will be created summarizes survey responses covering certain traits and skills of employees. It is stored in an Excel workbook with four sheets:
The report data is available here.
The three-page report was created using Datylon for Illustrator and exported to Datylon Report Studio after which each of the pages was downloaded as SVG. These are available at the following URLs:
You can also download the Adobe Illustrator file containing Datylon charts. If you choose to do so, make sure you also register, download, and install the Datylon for Illustrator plugin (a 14-day free trial is available here).
The demo database contains information about 20 different survey respondents. To automate the creation of a three-page report summarizing each of the respondent's data, a Python script was created. The following steps were implemented
The final reports (PDF files) are stored on the local disc but can easily be transferred or distributed using any delivery channel that supports PDF documents.
The complete Python script is available from the Datylon public bitbucket repository. A few representative snippets are provided below.
(src/config.py)
datylon_url = "https://insights.datylon.com/datyrender/api/render" |
Note that the Datylon Report Studio user and password are taken from environment variables and should be set before attempting to run the script.
(src/gen_reports.py)
def read_data(file_path): |
Each of the reports should only contain the data for one survey respondent. As such the data has to be filtered using the respondent’s name for which the report is being created.
(src/data_binding.py)
... |
The biggest part of the code deals with transforming the data from its input structure (the workbook sheets) to the data the designs expect when rendering with the Datylon Render Server.
For each Datylon workbook sheet, a JSON object is created. The code creates these objects ‘sheet’ per ‘sheet’ and then concatenates the results.
Below is a code snippet to illustrate the process.
(src/data_binding.py)
def p1(personality, benchmarks, respondent,json): |
After all JSON objects are created, they are merged into one JSON object.
def build_json(data, respondent): |
Once the JSON has been constructed using data extracted from the excel workbook, the Datylon Render server can be invoked, one invocation for each of the three pages of the design and for each of the respondents’ survey data.
A single invocation looks like this:
auth_string = f"{username}:{password}" |
The constructed JSON is used as the POST request payload (a complete example of such JSON can be found here. The UUID of the Datylon design is passed in as the x-graph-template-id header.
Finally, once the three pages of the design for a given survey respondent have been rendered, they can easily be concatenated to create one final PDF report. The file is named using the respondent name (selected_person_name.pdf).
pdfs = PyPDF2.PdfMerger() |
The complete script is available in a public bitbucket repo. The README information stored in the repository should give you enough information to run the report renderings and play around with it.
This paper illustrates a simple approach to setting up a report automation system based on the Datylon platform. The code fragments are designed to be easily adaptable and can serve as inspiration for the reader to create context-specific workflows.
By synergizing the creative capabilities of Adobe Illustrator with the power of the Datylon Illustrator Plugin and the developer-friendly Datylon Render Server API, a versatile Report Automation workflow emerges, requiring minimal development efforts.
Interested in experiencing the Datylon Report Server firsthand? Book a demo and let one of our experts guide you through its capabilities.
What is automated data reporting? A complete guide
Climbing the Ladder of Automated Reporting Solutions with Datylon
The Great Report Debate: Manual, Automated, or Interactive?
Automated reports: Defining Data Resources, Data Extraction and Transformation Options
Mastering Versioned Stand-Alone Reports
Building an automated reporting solution with Datylon Report Server
Automated Data Visualization Trends: What to Look for in Report Server Tools
Automated reporting for various industries:
Revolutionizing Marketing and Media: The Power of Automated Reporting
Automated Reporting in Asset and Wealth Management: Trends and Best Practices
Boosting Efficiency: How Automated Reporting Transforms Associations
The Power of Automated Reporting in the Pharmaceutical Industry