Welcome!

Microservices Expo Authors: Jason Bloomberg, Elizabeth White, Pat Romanski, Mehdi Daoudi, 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
Many organizations are now looking to DevOps maturity models to gauge their DevOps adoption and compare their maturity to their peers. However, as enterprise organizations rush to adopt DevOps, moving past experimentation to embrace it at scale, they are in danger of falling into the trap that they have fallen into time and time again. Unfortunately, we've seen this movie before, and we know how it ends: badly.
Leading companies, from the Global Fortune 500 to the smallest companies, are adopting hybrid cloud as the path to business advantage. Hybrid cloud depends on cloud services and on-premises infrastructure working in unison. Successful implementations require new levels of data mobility, enabled by an automated and seamless flow across on-premises and cloud resources. In his general session at 21st Cloud Expo, Greg Tevis, an IBM Storage Software Technical Strategist and Customer Solution Architec...
Many organizations adopt DevOps to reduce cycle times and deliver software faster; some take on DevOps to drive higher quality and better end-user experience; others look to DevOps for a clearer line-of-sight to customers to drive better business impacts. In truth, these three foundations go together. In this power panel at @DevOpsSummit 21st Cloud Expo, moderated by DevOps Conference Co-Chair Andi Mann, industry experts will discuss how leading organizations build application success from all...
The last two years has seen discussions about cloud computing evolve from the public / private / hybrid split to the reality that most enterprises will be creating a complex, multi-cloud strategy. Companies are wary of committing all of their resources to a single cloud, and instead are choosing to spread the risk – and the benefits – of cloud computing across multiple providers and internal infrastructures, as they follow their business needs. Will this approach be successful? How large is the ...
‘Trend’ is a pretty common business term, but its definition tends to vary by industry. In performance monitoring, trend, or trend shift, is a key metric that is used to indicate change. Change is inevitable. Today’s websites must frequently update and change to keep up with competition and attract new users, but such changes can have a negative impact on the user experience if not managed properly. The dynamic nature of the Internet makes it necessary to constantly monitor different metrics. O...
Enterprises are moving to the cloud faster than most of us in security expected. CIOs are going from 0 to 100 in cloud adoption and leaving security teams in the dust. Once cloud is part of an enterprise stack, it’s unclear who has responsibility for the protection of applications, services, and data. When cloud breaches occur, whether active compromise or a publicly accessible database, the blame must fall on both service providers and users. In his session at 21st Cloud Expo, Ben Johnson, C...
21st International Cloud Expo, taking place October 31 - November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA, will feature technical sessions from a rock star conference faculty and the leading industry players in the world. Cloud computing is now being embraced by a majority of enterprises of all sizes. Yesterday's debate about public vs. private has transformed into the reality of hybrid cloud: a recent survey shows that 74% of enterprises have a hybrid cloud strategy. Me...
Today companies are looking to achieve cloud-first digital agility to reduce time-to-market, optimize utilization of resources, and rapidly deliver disruptive business solutions. However, leveraging the benefits of cloud deployments can be complicated for companies with extensive legacy computing environments. In his session at 21st Cloud Expo, Craig Sproule, founder and CEO of Metavine, will outline the challenges enterprises face in migrating legacy solutions to the cloud. He will also prese...
Most of the time there is a lot of work involved to move to the cloud, and most of that isn't really related to AWS or Azure or Google Cloud. Before we talk about public cloud vendors and DevOps tools, there are usually several technical and non-technical challenges that are connected to it and that every company needs to solve to move to the cloud. In his session at 21st Cloud Expo, Stefano Bellasio, CEO and founder of Cloud Academy Inc., will discuss what the tools, disciplines, and cultural...
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 ...
With the rise of DevOps, containers are at the brink of becoming a pervasive technology in Enterprise IT to accelerate application delivery for the business. When it comes to adopting containers in the enterprise, security is the highest adoption barrier. Is your organization ready to address the security risks with containers for your DevOps environment? In his session at @DevOpsSummit at 21st Cloud Expo, Chris Van Tuin, Chief Technologist, NA West at Red Hat, will discuss: The top security r...
Agile has finally jumped the technology shark, expanding outside the software world. Enterprises are now increasingly adopting Agile practices across their organizations in order to successfully navigate the disruptive waters that threaten to drown them. In our quest for establishing change as a core competency in our organizations, this business-centric notion of Agile is an essential component of Agile Digital Transformation. In the years since the publication of the Agile Manifesto, the conn...
The nature of the technology business is forward-thinking. It focuses on the future and what’s coming next. Innovations and creativity in our world of software development strive to improve the status quo and increase customer satisfaction through speed and increased connectivity. Yet, while it's exciting to see enterprises embrace new ways of thinking and advance their processes with cutting edge technology, it rarely happens rapidly or even simultaneously across all industries.
These days, APIs have become an integral part of the digital transformation journey for all enterprises. Every digital innovation story is connected to APIs . But have you ever pondered over to know what are the source of these APIs? Let me explain - APIs sources can be varied, internal or external, solving different purposes, but mostly categorized into the following two categories. Data lakes is a term used to represent disconnected but relevant data that are used by various business units wit...
"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.
One of the biggest challenges with adopting a DevOps mentality is: new applications are easily adapted to cloud-native, microservice-based, or containerized architectures - they can be built for them - but old applications need complex refactoring. On the other hand, these new technologies can require relearning or adapting new, oftentimes more complex, methodologies and tools to be ready for production. In his general session at @DevOpsSummit at 20th Cloud Expo, Chris Brown, Solutions Marketi...
DevOps at Cloud Expo – being held October 31 - November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA – announces that its Call for Papers is open. Born out of proven success in agile development, cloud computing, and process automation, DevOps is a macro trend you cannot afford to miss. From showcase success stories from early adopters and web-scale businesses, DevOps is expanding to organizations of all sizes, including the world's largest enterprises – and delivering real r...
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.
As DevOps methodologies expand their reach across the enterprise, organizations face the daunting challenge of adapting related cloud strategies to ensure optimal alignment, from managing complexity to ensuring proper governance. How can culture, automation, legacy apps and even budget be reexamined to enable this ongoing shift within the modern software factory?
"When we talk about cloud without compromise what we're talking about is that when people think about 'I need the flexibility of the cloud' - it's the ability to create applications and run them in a cloud environment that's far more flexible,” explained Matthew Finnie, CTO of Interoute, in this SYS-CON.tv interview at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.