Page 1 of 1

Report with images

Posted: Wed Sep 11, 2019 5:06 am
by Fromm603
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?

Re: Report with images

Posted: Wed Sep 11, 2019 9:53 am
by MarkD
Maybe produce PDF documents on the server?

Re: Report with images

Posted: Thu Sep 12, 2019 5:20 am
by Fromm603
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.

Re: Report with images

Posted: Thu Sep 12, 2019 10:24 am
by MarkD
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 1095 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.

Re: Report with images

Posted: Thu Sep 12, 2019 11:55 am
by soa
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.

Re: Report with images

Posted: Thu Sep 19, 2019 4:57 am
by atostaine
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.

Re: Report with images

Posted: Thu Sep 19, 2019 5:36 am
by jyoung
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.