hexagon logo

How to Insert Multiple Images Into the Report

Hi All,

A bit over a year ago I asked this question on how to have an image generated on the fly shown in the report. The very helpful answer provided by was to create a custom report label template and use an Events script to update the image when the label is run. This works great when I only have one image. What I'm trying to do now, though, is run multiple similar calculations using subroutines and bring an image from each into my program.

Right now, my subroutine uses a particular custom label template, containing a single image. The subroutine copies the image I want to show to the file referenced in the label and then shows the label. When I run my test program, the report as shown in the report window looks as I would expect - a different image is shown for each subroutine call. However, the printed PDF shows the last shown image repeated each time the label is used. The same thing happens if I hit the refresh icon in the report window - the refreshed report shows the same image repeated.

Here's the code that calls my label in the subroutine. The image is copied into the right name using the FILE/COPY command, and the label name is specified by a variable so I can switch between development/test and production versions:

ASSIGN/IMAGENAME=TMPDIR + QUEUESTRUCT.OUTFILENAME + ".bmp"
FILE/COPY,IMAGENAME,TMPDIR + "SHOW_temporary_image_file.bmp",OVERWRITE
REPORT/LABEL, FILENAME= REPTLABEL​


Here's the event update code in the label template, under event "EventReportData":

this.Bitmap = "C:\CMM_local_data\tmp\SHOW_temporary_image_file.bmp"


The only thing in my label template is this bitmap object.

Is there some way (perhaps specifying a different event? How would I do that?) to "lock" the label template to the image it loads when the REPORT/LABEL command is called? Is there another way to accomplish loading multiple different images through a label template like this?
Parents
  • Yeah, I found the same thing - the image doesn't update like it's supposed to unless you force it using a trick like showed me.

    Creating a separate label should work, but since I'm trying to do this in a subroutine calling a different label each time would be a pain in the neck. I'd probably have to have a "master" label template file that I'd programmatically copy to a unique name and then load. I was hoping there would be a setting somewhere that would fix my issue without all that rigamarole.

    I've been sticking with .bmp just to avoid the quality degradation that .jpg files produce. It would be really nice if they would support a modern decent file type like .png, but apparently no dice on that one...
Reply
  • Yeah, I found the same thing - the image doesn't update like it's supposed to unless you force it using a trick like showed me.

    Creating a separate label should work, but since I'm trying to do this in a subroutine calling a different label each time would be a pain in the neck. I'd probably have to have a "master" label template file that I'd programmatically copy to a unique name and then load. I was hoping there would be a setting somewhere that would fix my issue without all that rigamarole.

    I've been sticking with .bmp just to avoid the quality degradation that .jpg files produce. It would be really nice if they would support a modern decent file type like .png, but apparently no dice on that one...
Children
No Data