Welcome!

Microservices Expo Authors: Kelly Burford, Scott Davis, Elizabeth White, Pat Romanski, PagerDuty Blog

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
Some journey to cloud on a mission, others, a deadline. Change management is useful when migrating to public, private or hybrid cloud environments in either case. For most, stakeholder engagement peaks during the planning and post migration phases of a project. Legacy engagements are fairly direct: projects follow a linear progression of activities (the “waterfall” approach) – change managers and application coders work from the same functional and technical requirements. Enablement and develo...
For DevOps teams, the concepts behind service-oriented architecture (SOA) are nothing new. A style of software design initially made popular in the 1990s, SOA was an alternative to a monolithic application; essentially a collection of coarse-grained components that communicated with each other. Communication would involve either simple data passing or two or more services coordinating some activity. SOA served as a valid approach to solving many architectural problems faced by businesses, as app...
The “Digital Era” is forcing us to engage with new methods to build, operate and maintain applications. This transformation also implies an evolution to more and more intelligent applications to better engage with the customers, while creating significant market differentiators. In both cases, the cloud has become a key enabler to embrace this digital revolution. So, moving to the cloud is no longer the question; the new questions are HOW and WHEN. To make this equation even more complex, most ...
The past few years have brought a sea change in the way applications are architected, developed, and consumed—increasing both the complexity of testing and the business impact of software failures. How can software testing professionals keep pace with modern application delivery, given the trends that impact both architectures (cloud, microservices, and APIs) and processes (DevOps, agile, and continuous delivery)? This is where continuous testing comes in. D
SYS-CON Events announced today that Synametrics Technologies will exhibit at SYS-CON's 22nd International Cloud Expo®, which will take place on June 5-7, 2018, at the Javits Center in New York, NY. Synametrics Technologies is a privately held company based in Plainsboro, New Jersey that has been providing solutions for the developer community since 1997. Based on the success of its initial product offerings such as WinSQL, Xeams, SynaMan and Syncrify, Synametrics continues to create and hone in...
Many IT organizations have come to learn that leveraging cloud infrastructure is not just unavoidable, it’s one of the most effective paths for IT organizations to become more responsive to business needs. Yet with the cloud comes new challenges, including minimizing downtime, decreasing the cost of operations, and preventing employee burnout to name a few. As companies migrate their processes and procedures to their new reality of a cloud-based infrastructure, an incident management solution...
Some people are directors, managers, and administrators. Others are disrupters. Eddie Webb (@edwardawebb) is an IT Disrupter for Software Development Platforms at Liberty Mutual and was a presenter at the 2016 All Day DevOps conference. His talk, Organically DevOps: Building Quality and Security into the Software Supply Chain at Liberty Mutual, looked at Liberty Mutual's transformation to Continuous Integration, Continuous Delivery, and DevOps. For a large, heavily regulated industry, this task...
Modern software design has fundamentally changed how we manage applications, causing many to turn to containers as the new virtual machine for resource management. As container adoption grows beyond stateless applications to stateful workloads, the need for persistent storage is foundational - something customers routinely cite as a top pain point. In his session at @DevOpsSummit at 21st Cloud Expo, Bill Borsari, Head of Systems Engineering at Datera, explored how organizations can reap the bene...
Kubernetes is an open source system for automating deployment, scaling, and management of containerized applications. Kubernetes was originally built by Google, leveraging years of experience with managing container workloads, and is now a Cloud Native Compute Foundation (CNCF) project. Kubernetes has been widely adopted by the community, supported on all major public and private cloud providers, and is gaining rapid adoption in enterprises. However, Kubernetes may seem intimidating and complex ...
Gaining visibility in today’s sprawling cloud infrastructure is complex and laborious, involving drilling down into tools offered by various cloud services providers. Enterprise IT organizations need smarter and effective tools at their disposal in order to address this pertinent problem. Gaining a 360 - degree view of the cloud costs requires collection and analysis of the cost data across all cloud infrastructures used inside an enterprise.
You know you need the cloud, but you’re hesitant to simply dump everything at Amazon since you know that not all workloads are suitable for cloud. You know that you want the kind of ease of use and scalability that you get with public cloud, but your applications are architected in a way that makes the public cloud a non-starter. You’re looking at private cloud solutions based on hyperconverged infrastructure, but you’re concerned with the limits inherent in those technologies.
Gone are the days when application development was the daunting task of the highly skilled developers backed with strong IT skills, low code application development has democratized app development and empowered a new generation of citizen developers. There was a time when app development was in the domain of people with complex coding and technical skills. We called these people by various names like programmers, coders, techies, and they usually worked in a world oblivious of the everyday pri...
Our work, both with clients and with tools, has lead us to wonder how it is that organizations are handling compliance issues in the cloud. The big cloud vendors offer compliance for their infrastructure, but the shared responsibility model requires that you take certain steps to meet compliance requirements. Which lead us to start poking around a little more. We wanted to get a picture of what was available, and how it was being used. There is a lot of fluidity in this space, as in all things ...
The dynamic nature of the cloud means that change is a constant when it comes to modern cloud-based infrastructure. Delivering modern applications to end users, therefore, is a constantly shifting challenge. Delivery automation helps IT Ops teams ensure that apps are providing an optimal end user experience over hybrid-cloud and multi-cloud environments, no matter what the current state of the infrastructure is. To employ a delivery automation strategy that reflects your business rules, making r...
The notion of improving operational efficiency is conspicuously absent from the healthcare debate - neither Obamacare nor the newly proposed GOP plan discusses the impact that a step-function improvement in efficiency could have on access to healthcare (through more capacity), quality of healthcare services (through reduced wait times for patients) or cost (through better utilization of scarce, expensive assets).
Admiral Calcote - also known as Lee Calcote (@lcalcote) or the Ginger Geek to his friends - gave a presentation entitled Characterizing and Contrasting Container Orchestrators at the 2016 All Day DevOps conference. Okay, he isn't really an admiral - nor does anyone call him that - but he used the title admiral to describe what container orchestrators do, relating it to an admiral directing a fleet of container ships. You could also say that they are like the conductor of an orchestra, directing...
Cloud Governance means many things to many people. Heck, just the word cloud means different things depending on who you are talking to. While definitions can vary, controlling access to cloud resources is invariably a central piece of any governance program. Enterprise cloud computing has transformed IT. Cloud computing decreases time-to-market, improves agility by allowing businesses to adapt quickly to changing market demands, and, ultimately, drives down costs.
Recent survey done across top 500 fortune companies shows almost 70% of the CIO have either heard about IAC from their infrastructure head or they are on their way to implement IAC. Yet if you look under the hood while some level of automation has been done, most of the infrastructure is still managed in much tradition/legacy way. So, what is Infrastructure as Code? how do you determine if your IT infrastructure is truly automated?
Every few years, a disruptive force comes along that prompts us to reframe our understanding of what something means, or how it works. For years, the notion of what a computer is and how you make one went pretty much unchallenged. Then virtualization came along, followed by cloud computing, and most recently containers. Suddenly the old rules no longer seemed to apply, or at least they didn’t always apply. These disruptors made us reconsider our IT worldview.
As people view cloud as a preferred option to build IT systems, the size of the cloud-based system is getting bigger and more complex. As the system gets bigger, more people need to collaborate from design to management. As more people collaborate to create a bigger system, the need for a systematic approach to automate the process is required. Just as in software, cloud now needs DevOps. In this session, the audience can see how people can solve this issue with a visual model. Visual models ha...