Report with images

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
Posts: 20
Joined: Fri Apr 26, 2019 10:51 pm

Report with images

Post by Fromm603 » Wed Sep 11, 2019 5:06 am

Anyone know the best way to create reports that contain images using LANSA? I am experimenting with the #Report method, but it simply doesn't handle images well at all.
Some images are more vertical, some more horizontal. The images lose so much quality (and aspect ratio) they simply look horrible. Do I have to resize all of the images?
How big should they be? Is 300 DPI considered high resolution?

Posts: 627
Joined: Wed Dec 02, 2015 9:56 am

Re: Report with images

Post by MarkD » Wed Sep 11, 2019 9:53 am

Maybe produce PDF documents on the server?

Posts: 20
Joined: Fri Apr 26, 2019 10:51 pm

Re: Report with images

Post by Fromm603 » Thu Sep 12, 2019 5:20 am

Not quite sure what that means (PDFs on our IBMi?). We bought LANSA to do these things (images on a report or screen). But it's not quite as advertised.
The person here, uses a product called Adobe Indesign, but that's a painfully manual process. I wanted to automate things.

Posts: 627
Joined: Wed Dec 02, 2015 9:56 am

Re: Report with images

Post by MarkD » Thu Sep 12, 2019 10:24 am

There are a lot of ‘reporting’ options available these days – it can be confusing.
I’ll try to describe the ones I know of and their respective roles in the LANSA product:

(1). The “#Report” reusable part mentioned earlier is just a shipped VLF-ONE example of how you might produce reports on the client-side of a VL-Web application. It consists of 4 usage examples, DF_T69H1O, H2O, H3O and H4O along with a common interface reusable part DF_T69CTO (usually named #Report locally) and a widget #DF_T69RPO. The source code is shipped for all of these components.
The “DF_” prefix denotes a demonstration function, as do the “Please Note” comments at the start of each example. The expectation is that a demonstration example function will rarely do exactly what you need, but rather provide a starting point, with example code, that you can copy and customize to meet your exact requirements.

(2). The official LANSA RDMLX language server-side reporting commands are listed here ... report.htm .
These are all text based and have no image capabilities. They produce classic IBM i line printer style spool files on IBM i and Windows platforms.
I am pretty sure that the IBM i operating system has several build-in features now that can dynamically create or convert these spool files in/to PDF format.

(3). I think many applications, both LANSA and non-LANSA based, nowadays deliver ‘reports’ to end users as either PDF or XLS (MS-Excel) files.
This is because the required content viewers and hard copy printing abilities are ubiquitous, they are easily transported, and in the case of XLS documents they can be further manipulated by the end user using pivot tables, creating graphs, etc.
LANSA Integrator provides specific services to produce both of these types of file on IBM i and Windows platforms.
The LANSA Integrator guide is here -
There are getting started tutorial for creating XLS and PDF documents on your IBM I server:

Capture.PNG (61.49 KiB) Viewed 172 times

As far as option (3) goes – my impression is that many LANSA customers do this, so hopefully other people can contribute some ideas, examples, scenarios and to answer any questions you have.

Posts: 302
Joined: Mon Dec 07, 2015 3:15 pm

Re: Report with images

Post by soa » Thu Sep 12, 2019 11:55 am

If you are using VLWEB it possible, via a widget, to create complex PDFs on the browser side with several JavaScript libraries such as jspdf. In fact, these can be made to work on the iseries by executing the VLWEB RP in node.js. If you want PDFs on the iSeries side then LANSA Integrator is the way to go.

Posts: 414
Joined: Wed Jan 20, 2016 7:38 am

Re: Report with images

Post by atostaine » Thu Sep 19, 2019 4:57 am

For VL-Win, we do reports with images using the Excel activex. Works really well. We just open the xls for the user and they can do whatever they want with it, rearrange columns, delete columns or rows, etc.

We are IBM i, so for web reports we ask for an email address and email the report or open the PDF in another tab. We can create it on the server with RPG or whatever tools we want.
Art Tostaine

Posts: 653
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: Report with images

Post by jyoung » Thu Sep 19, 2019 5:36 am

We use Integrator's PDFDocumentService quite a bit.
After the initial shock of having to write the XML template, it really is not that bad and most of my templates are pretty small.
There is some trial and error involved to get the spacing right, but after a couple you tend to get an idea of what's going on and where things need to go.

Biggest challenge with the PDFDocumentService IMHO, is handling paging. It requires you to know how many lines you have written (and how tall) each line is to know when you need to break.

It supports importing an image as well. ... 7_3540.htm

Some reports take more than a few seconds to create, so we ask for an email and submit the job to batch and email the user the PDF as an attachment.

We also use (lesser extent) the ExcelService ... 7_4010.htm

Using a template we created in Excel, we can essentially pump data into a known cell range and create some pretty interesting spreadsheets. I have not specifically used a template with an image, but I would think it would be feasible.


Post Reply