Welcome!

Microservices Expo Authors: Matt Brickey, Elizabeth White, Christoph Schell, Pat Romanski, Liz McMillan

Related Topics: Microservices Expo, @CloudExpo

Microservices Expo: Blog Post

Reports? Docx the Solution

You can create report templates in docx format with a simple word processor...

Reports creation is a common problem to face with, when developing web applications. When designing a report, usually a tool is needed to define the report content and the usage of such tools is not always easy and intuitive. Consequently, specific skills and expertise are required in order to use these products.

The same problem arose also with a Rapid Application Development tool like 4WS.Platform, a product designed specifically to speed up and make it easier the creation of web and mobile applications, having an high level of customization and allowing the creation of applications to  users having basic skills.

Which solution can be provided to users in order to make it easy and fast the creation of reports within 4WS.Platform? How to do that in a similar simple way already available in that product for other tasks?

Word processors like Microsoft WordTM[1], Open Office o Libre Office are widespread solutions whose usage is easy and well known by a large amount of users. People know how to use them, for instance to write a letter, compile a bill, an essay or to create a resume, etc.

Why don't exploit the knowledge of these editors that everyone has and start from that?

These editors procude documents in a docx format, which is based on an XML descriptor easily readable by 4WS.Platform.

The widespread of these tools, the semplicity in the creation of documents and the chance to exploit the XML format behind the scenes easily readable are the main reasons for the adoption of the docx format to use for the document template within 4WS.Platform for the reports generation.

In this way, any user can create document templates using these popular editors, format and organize data as they wish and follow simple rules to create a model to populate and finally publish them inside 4WS.Platform to generate reports.

How to create a docx template
As described in the introduction, a user can create his own template by following a few simple rules, but first of all, he can fill in the template, format the content, define the content layout and focus mainly on the result he wants to reach.

Once defined the "static" content and layout of the template, the user has to focus on the "dynamic" parts of the document, which will be replaced with data provided by the application, when generating the report starting from the template.
Finally, when the template has been deployed within 4WS.Platform, queries have to be defined to feed the report for those parts.

Variables
Two kinds of variables written in the docx template are supported by 4WS.Platform. These variables have the following syntax:

4WS.Platform - Modello Docx

  1. <control>value</control>
    the value will be replaced with data retrieved through the execution of the query linked to that part of the template
  2. <translation>description</translation>
    the description will be replaced with data coming from the query execution and translated according to the language used when generating to the report.

The result is reported in the following images.

4WS.Platform - Report

Subreport
In addition to what just described, two types of subreports are supported by 4WS.Platform:

  • a ‘table subreport' used to show a list of records
  • a ‘form subreport', used to show values coming for a single report.

These two subreports have the following syntax:

  1. <table>table</table>
    where ‘table' is the name assigned to the ‘table subreport', in order to identify it and, for each column of that subreport, an identifier having this syntax:<td>column1</td> <td>column2</td> ...It is always possible to include cells whose content is translated according to the report language, using the tag: ‘tdtranslation‘.
    All cells having <td> tag will be replicated for each record read through the execution of query linked to that subreport.
    Here it is an example of the result of such a kind of subreport.
  2. <subform>subform</subform>
    where subform is the name assigned to the subreport and whose controls are identified by ‘subcontrol' tags or ‘subcontroltranslation' tags, in case of data to translate according to the report language.

How to feed the template
Once the user has defined the template, a query has to be written to provide data to show in the report and for each subreport.

4WS.Platform provides several ways to define those queries, through what is called a ‘business component': the user can define the SQL query manually or use the automatic query composition provided by the 4WS.Platform feature.

How to configure a report
When the user has defined the template and the queries to feed it, the next step is to configure the report within the "Web Designer" component of 4WS.Platform.

In order to complete the template configuration and make it possible to generate a report, 4 simple steps are needed:

1. Uploading the template
The first step includes the name specification for the report and the selection of a business component to link to the report in order to fill in the main section of the report.

Through this feature, the user can choose the docx template file to upload: it is possible to upload a different file for each language, with the constraint that each of these templates have to share the same structure, so that it is possible to fill in each of them with the same data structure.

4WS.Platform - Report inserimento nuovo modello

2. Parameters
The report content could depend on data passed in input to that report. That means that the single SQL query could have variables which should be filled with dynamic data. For each of these variables a parameter can be defined along with the other settings provided when defining the report. These parameters have a data type which can be: text, number or date. They can be used when mapping SQL query variables with ad hoc data.

4WS.Platform  - Report parametri

3. Report fields
Once uploaded the docx template, the file is analyzed and a grid is prompted to the user, showing the fields found inside the template that require a mapping, that is to say, to map to the query fields, in order to fill them in.

For each of these bindings, it is possible to define a predefined data format (text, date, integer, decimal, etc.) or take advantage of advanced formatting methods provided by 4WS.Platform.

In the screenshot reported below, a function named ‘formatNumber' is used to manage the number format, but it is also available a special function to convert a number to its text representation, expressed in a specific language.

4WS.Platform - Report campi del report

4. Subreports
In case the uploaded docx template contained subreports (table or form subreports type), a second grid would show the list of these subreports. Through that grid, the user can bind each subreport with a business component (a SQL query) to use to feed that subreport.

Moreover, for each subreport the mapping between its fields and the query fields must be defined by the user, in the same way done for the main region of the report.

4WS.Platform - Report sottoreport

A user can change any part of these report settings any number of times: he can change format settings, mappings or change the template content (e.g. static content) by simply uploading the docx file again.

Report generation
When the user has completed the report settings, the template could be invoked in order to generate a report starting from it and data coming from the execution of the SQL queries.

A report can be generated by invoking it through a server-side action.

A javascript server-side action is a special component provided by 4WS.Platform which allows the creation of simple programs written using the javascript language and executed on the server side of the web application.

In the simplest case, such an action would simply contain a line of code to generate the report, starting from the docx file location:

utils.generateDocx(reportId, args, langId, path, fileName);

Once the report has been generated (in docx format), it is also possible to convert it in another format, for instance a report in PDF format.

Conclusion
To sum up, a report can be produced on the fly without the need to know how to use ad hoc report editors or pay for costly licenses. You can create report templates in docx format with a simple word processor and through 4WS.Platform automate the report generation.

Thanks to popular text editors able to manage docx file format, any newbie user can create report templates and with the simple and intuitive web interface included in the 4WS.Platform solution anyone can also be able to configure and manage the report generation.

[1] Microsoft, Encarta, MSN, and Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.

More Stories By Lorenzo Luccon

Lorenzo Luccon is a Software Architect at Sinesy. He has more than 10 years of enterprise software development experience utilizing JEE technologies, including JSP, JS, Swing, EJB, JPA. He started focusing more on GUI-based client/server Java applications since 2001, then moved to web rich applications, including Sencha ExtJS.

@MicroservicesExpo Stories
From personal care products to groceries and movies on demand, cloud-based subscriptions are fulfilling the needs of consumers across an array of market sectors. Nowhere is this shift to subscription services more evident than in the technology sector. By adopting an Everything-as-a-Service (XaaS) delivery model, companies are able to tailor their computing environments to shape the experiences they want for customers as well as their workforce.
If you read a lot of business and technology publications, you might think public clouds are universally preferred over all other cloud options. To be sure, the numbers posted by Amazon Web Services (AWS) and Microsoft’s Azure platform are nothing short of impressive. Statistics reveal that public clouds are growing faster than private clouds and analysts at IDC predict that public cloud growth will be 3 times that of private clouds by 2019.
"Outscale was founded in 2010, is based in France, is a strategic partner to Dassault Systémes and has done quite a bit of work with divisions of Dassault," explained Jackie Funk, Digital Marketing exec at Outscale, in this SYS-CON.tv interview at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
"DivvyCloud as a company set out to help customers automate solutions to the most common cloud problems," noted Jeremy Snyder, VP of Business Development at DivvyCloud, in this SYS-CON.tv interview at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
"We focus on SAP workloads because they are among the most powerful but somewhat challenging workloads out there to take into public cloud," explained Swen Conrad, CEO of Ocean9, Inc., in this SYS-CON.tv interview at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
"As we've gone out into the public cloud we've seen that over time we may have lost a few things - we've lost control, we've given up cost to a certain extent, and then security, flexibility," explained Steve Conner, VP of Sales at Cloudistics,in this SYS-CON.tv interview at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
"Peak 10 is a hybrid infrastructure provider across the nation. We are in the thick of things when it comes to hybrid IT," explained , Chief Technology Officer at Peak 10, in this SYS-CON.tv interview at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
"I think DevOps is now a rambunctious teenager – it’s starting to get a mind of its own, wanting to get its own things but it still needs some adult supervision," explained Thomas Hooker, VP of marketing at CollabNet, in this SYS-CON.tv interview at DevOps Summit at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
"I will be talking about ChatOps and ChatOps as a way to solve some problems in the DevOps space," explained Himanshu Chhetri, CTO of Addteq, in this SYS-CON.tv interview at @DevOpsSummit at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
Your homes and cars can be automated and self-serviced. Why can't your storage? From simply asking questions to analyze and troubleshoot your infrastructure, to provisioning storage with snapshots, recovery and replication, your wildest sci-fi dream has come true. In his session at @DevOpsSummit at 20th Cloud Expo, Dan Florea, Director of Product Management at Tintri, provided a ChatOps demo where you can talk to your storage and manage it from anywhere, through Slack and similar services with...
If you are thinking about moving applications off a mainframe and over to open systems and the cloud, consider these guidelines to prioritize what to move and what to eliminate. On the surface, mainframe architecture seems relatively simple: A centrally located computer processes data through an input/output subsystem and stores its computations in memory. At the other end of the mainframe are printers and terminals that communicate with the mainframe through protocols. For all of its apparen...
DevOps at Cloud Expo, taking place October 31 - November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA, is co-located with 21st Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry players in the world. The widespread success of cloud computing is driving the DevOps revolution in enterprise IT. Now as never before, development teams must communicate and collaborate in a dynamic, 24/7/365 environment. There is no time to w...
There is a huge demand for responsive, real-time mobile and web experiences, but current architectural patterns do not easily accommodate applications that respond to events in real time. Common solutions using message queues or HTTP long-polling quickly lead to resiliency, scalability and development velocity challenges. In his session at 21st Cloud Expo, Ryland Degnan, a Senior Software Engineer on the Netflix Edge Platform team, will discuss how by leveraging a reactive stream-based protocol,...
"At the keynote this morning we spoke about the value proposition of Nutanix, of having a DevOps culture and a mindset, and the business outcomes of achieving agility and scale, which everybody here is trying to accomplish," noted Mark Lavi, DevOps Solution Architect at Nutanix, in this SYS-CON.tv interview at @DevOpsSummit at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
For over a decade, Application Programming Interface or APIs have been used to exchange data between multiple platforms. From social media to news and media sites, most websites depend on APIs to provide a dynamic and real-time digital experience. APIs have made its way into almost every device and service available today and it continues to spur innovations in every field of technology. There are multiple programming languages used to build and run applications in the online world. And just li...
Data reduction delivers compelling cost reduction that substantially improves the business case in every cloud deployment model. No matter which cloud approach you choose, the cost savings benefits from data reduction should not be ignored and must be a component of your cloud strategy. IT professionals are finding that the future of IT infrastructure lies in the cloud. Data reduction technologies enable clouds — public, private, and hybrid — to deliver business agility and elasticity at the lo...
DevOps is often described as a combination of technology and culture. Without both, DevOps isn't complete. However, applying the culture to outdated technology is a recipe for disaster; as response times grow and connections between teams are delayed by technology, the culture will die. A Nutanix Enterprise Cloud has many benefits that provide the needed base for a true DevOps paradigm. In their Day 3 Keynote at 20th Cloud Expo, Chris Brown, a Solutions Marketing Manager at Nutanix, and Mark Lav...
"NetApp's vision is how we help organizations manage data - delivering the right data in the right place, in the right time, to the people who need it, and doing it agnostic to what the platform is," explained Josh Atwell, Developer Advocate for NetApp, in this SYS-CON.tv interview at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
Five years ago development was seen as a dead-end career, now it’s anything but – with an explosion in mobile and IoT initiatives increasing the demand for skilled engineers. But apart from having a ready supply of great coders, what constitutes true ‘DevOps Royalty’? It’ll be the ability to craft resilient architectures, supportability, security everywhere across the software lifecycle. In his keynote at @DevOpsSummit at 20th Cloud Expo, Jeffrey Scheaffer, GM and SVP, Continuous Delivery Busine...
"We do one of the best file systems in the world. We learned how to deal with Big Data many years ago and we implemented this knowledge into our software," explained Jakub Ratajczak, Business Development Manager at MooseFS, in this SYS-CON.tv interview at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.