Technical Services
Non Insurance Services
Document Components
Print Management
Jasper Document Generation
Sidebar On this page

Introduction

insureMO’s Jasper Document Generation service is a report rendering service based on JasperReport. It specializes in generating various types of PDF reports. Rather than directly exposing an API to external users, this service is accessed through the Print Management Service API, allowing users to generate the necessary PDF reports.

Currently, the service supports solely JSON as the data source. As for export formats, it offers a variety of options, including PDF, HTML, Excel, CSV, and Word. For the PDF service, an encryption function is provided. It supports two encryption passwords: one for reading and the other for modification.

This service is deprecated. Please use the HTML Document Generation Service and the Word Document Generation Service instead. More and more customers tell us this tool is hard to design templates with, so we developed these two alternatives: the Word Document Generation Service is easy for normal users to design templates themselves, and the HTML Document Generation Service is easy to generate with AI. Both save users a lot of time when designing templates.

Quick Start

  1. Use Jaspersoft Studio to design template.

    img_1.png
  2. Upload template.

    a. Click Sign in to log in to insureMO Portal with your personal account.

    info

    If you do not have a personal insureMO account, click Sign up to register one.

    b. Click Catalog at the top of the home page.

    c. In the left pane of Catalog page, navigate to Utility & AI > Output & Document Management to find the Print Management Service service card.

    d. Click Upload Template on the page. Template Type is jasper2. img_3.png

  3. Generate PDF. img_2.png

  • Click Create Task on the page, input templatename + print data on it, and download it on the page after the task is completed.
  • Calling API, see :(https://docs.insuremo.com/non_insurance_service/docs/md/InsureMO_Print#post-printv2printtaskgenerate) and make sure the "print_doc_type" : "jasper2".

JasperReport Overview

JasperReport is a powerful, open-source report generation tool widely used in Java applications for creating dynamic, pixel-perfect reports. Backed by the Jaspersoft Community, it offers robust features for data integration, report design, and multi-format output, making it a leading choice for embedded analytics and enterprise reporting.

Key Features & Tools

Technical Foundations:

  • Built in Java, ensuring cross-platform compatibility across operating systems.

  • Open-source and freely available, with optional paid documentation and support.

Core Functionality:

Jasper Report Design

Install a jasper report studio

  • Download and install from:https://community.jaspersoft.com/project/jaspersoft-studio
  • Use the jasper report version 6.20.0. Other new versions may have some functions which are not supported.
  • Notice the release notes of container, if we upgrade the jasper docgen service, upgrade your version too.

1. Create a JSON Datasource Template

  1. Create New DataSource. Right-click Data Adapter, then click Create Data Adapter.
5
  1. Select a datasource you want, and choose JSON File.
6
note

The JSON file must have a root.

The file showed below is not a valid JSON file for Jasper report source.

7

And this one is a proper one:

8
  1. Click Next, select the JSON file you prepared, and then click Finish.
9

2. Create a New Report File

  1. Click FILE >New >Jasper Report, or right click MyReports >New >Jasper Report.
10
  1. Choose the size and format of the page you need.
    Blank A4 is selected here.
11
  1. Write the file name, click Next.
12
  1. Choose the datasource you created just now.
13
  1. Double click the root path Info.
14
  1. Click Next, choose all fields (you can choose the fields you need, not all the fields you need), then click Next.
15
  1. Click Next, choose all fields (you can choose the fields you need, not all the fields you need), click Next.
16 17

3. Design a New Report

  1. Open the fields under the OutLine tab, then drag and drop the fields to the page header, column header, or details section as needed.
18

After the design, the following new template is generated.

19

In this template, if there are no train in the JSON datasource, the three lines below the policy information will not be displayed.

Below is an example:

A. The JSON file has a train number

20

Click Preview to see the result:

21

B. The JSON file does not have a train number

22

Click Preview to see the result:

23

Choose the export format. Normally, PDF is used for containers.

4.Insert a image to the Template

  1. Import the image into the workspace. Select it from the filesystem and click Finish.
25
  1. Drag and drop the image into the template.
27
  1. Select Workspace Resource. If you select the absolute path in the file system, you will not find the image when the template is uploaded to the document generation server. Please select the flight.jpg image which is just imported.
28
  1. Adjust the image to your needed size.
29
  1. Right click and send image back as a background.
30

5. Insert a Sub Report to the Template

  1. Prepare a subreport as shown in the image.
31
  1. Click Subreport, select an existed report, and then choose the subreport you have just prepared.
32 33
  1. Click Finish, If the subreport contains only static text, it will be empty. To display content, ensure the subreport uses the same JSON data source as the main report.

How to fix it:

Not click Finish, click Next and set the datasource. For different datatypes, the datasource expression is not the same. This is just for JSON file, xml file is another source.

34 35

Now, the subreport could be seen.

36

6.Create a Sub-report Whose Datasource is the Same with Main-report

This section will introduce how to create a subreport that shares the same data source as the main report, especially when you want to list all the records which you don’t know the total number.

For example, use JSON as the datasource (which is the same as the main-report) to list all the insured individuals’ information in the sub-report. As shown in the image, two insured individuals are listed here.

37

After selecting the datasource, you will find that all the fields are displayed on the left panel. Then design the subreport as a common report.

38

7. Zip All the Needed Files and Upload Them to the Document Generation System.

All images, subreports, and the main-report must be uploaded to the server together.

If you have a sub-report in your folder, name the zip file the same as the main-report so the print server can identify the main report. Or you can name the main-report as index.jrxml.

How to build jrxml to Jasper file

open the jasper studio 6.20.6 version,import the jrxml file,right click MyReports->Build Project, you will get the *.jasper file with the same name as the jrxml file. 39

Supported Fonts

All the supported fonts are available for download from your repo. Input -fonts, find the highest version for this jar file, download and unzip it.

Ensure your company possesses the font license when using these fonts. Contact the font vendor for proper business authorization.

Use the fonts currently supported when designing your template. Contact the support team to add other fonts if needed, though this may take time. Using existing fonts saves time.

note

This document may include links to external websites and third-party features for demonstration purposes only. These links and features do not imply our endorsement or recommendation. We do not control and are not responsible for the content, services, or privacy practices of these third parties. Users should independently review their terms and privacy policies.

FAQs

Q: I can’t find all the information I need in your jasperReport studio design document, do you have more information for me to create the template?

A: If you have any questions when using Jasper Report Studio Design, you can search for more online tutorials, as jasperReport is an openSource tool. For example: Tutorialspoint.


Feedback
Was this page helpful?
|
Provide feedback