Displaying bitmap files in records

31 views
Skip to first unread message

Penri

unread,
Oct 22, 2009, 12:33:54 PM10/22/09
to triDeveloper
We currently have an interface that passes bitmap images of customer
signatures into documents that sit with the document manager in
Tririga (8i - 2.1.9.6). We then have records that have a locator field
that link to those documents so the user can view ths signature but
only by clicking on the link and then clicking download.

We're looking to display the the bitmap image directly in the record's
GUI rather than as a link. Could anyone suggest how we can achieve
this?

Thanks in advance.

Eric Glass

unread,
Oct 22, 2009, 1:01:40 PM10/22/09
to tridev...@googlegroups.com
So you have the bitmaps checked into document manager, correct?  And they (the document records containing the bitmap) are associated to the target record, and you want to have a section on the target record displaying the bitmap?
 
One solution would be to retain the locator (so you can select the document); then add a hidden text field and use the locator mapping (in data modeler, for the locator field) to also pull in the triRecordIdSY from the Document record and populate that in the hidden field on your target record.
 
You would then have an HTML file as a report section on your target GUI, with a bit of Javascript to pull in the document record ID if present (e.g. "%%RecordInformation_triDocumentIdTX%%" or similar) and generate an IMG tag pointing back to the document.  The format for the image source URL would be:
 
/WebProcess.srv?objectId=410000&actionId=410014&disp=false&documentID=XXXXX
 
where "xxxxx" is the record ID.  You could use an HTML section with just that img link directly, e.g.:
 
<img src="/WebProcess.srv?objectId=410000&actionId=410014&disp=false&documentID=%%RecordInformation_triDocumentIdTX%%">
 
but then if you didn't have a bitmap it would show an ugly broken image picture.  Checking via Javascript to see if the value is populated allows you to avoid that.  I'm getting ready to go to a conference session now but will try and slap some more stuff up in a bit with more details.
 
 
Eric

Eric Glass

unread,
Oct 22, 2009, 3:02:45 PM10/22/09
to tridev...@googlegroups.com
Here's a bit more detail...
 
First you set up your "target" object (the one that will be displaying your bitmap) to have a text field (here I'm calling it "triDocumentIdTX") that gets populated with the triRecordIdSY from the linked Document record (which is the bitmap, loaded in document manager).  The easiest way to do this is probably to add it as a locator mapping in the data modeler (select the locator field you have pointing at the document, and select "Edit Mapping" to bring in the triRecordIdSY from the document record and map it to triDocumentIdTX on your target record).  Basically we just need to have a way to get a handle on the record ID of the document.
 
Next, save the following in an HTML file and check it into document manager:
 
<html>
<head>
<script type="text/javascript">
    function loadImage() {
        var imageId = Number("%%RecordInformation_triDocumentIdTX%%");
        if (isNaN(imageId)) return;
        var img = document.createElement("img");
        img.src = "/WebProcess.srv?objectId=410000&actionId=410014&" +
                "disp=false&documentID=" + imageId;
        document.body.appendChild(img);
    }
</script>
</head>
<body onload="loadImage();">
</body>
</html>
 
Create a Report section on your target object GUI and select this file as the document.  This bit of script will pull the record id from the triDocumentIdTX field; if it has a valid one (does a check to make sure it contains a number) then it creates an image tag in the body of the section, pointing at the bitmap document record.
 
Note that if you already have documents linked up, you'll need to either clear and repopulate the locator to ensure the hidden field gets populated, or slap together a workflow to do it.  Also, locator mapped fields are only populated when the locator is filled via the GUI (i.e. not if you push them in via Data Integrator or similar), and aren't cleared when the locator is cleared; if you need/want to do either of those things you'd have to resort to a workflow to ensure the record ID field remains up to date properly.

Penri

unread,
Oct 23, 2009, 8:12:53 AM10/23/09
to triDeveloper
Thanks for that detailed reply Eric, as always your help is very much
appreciated. I will give it a go and let you know how I got on.
> > src="/WebProcess.srv?objectId=410000&actionId=410014&disp=false&documentID=­%%RecordInformation_triDocumentIdTX%%">
>
> > but then if you didn't have a bitmap it would show an ugly broken image
> > picture.  Checking via Javascript to see if the value is populated allows
> > you to avoid that.  I'm getting ready to go to a conference session now but
> > will try and slap some more stuff up in a bit with more details.
>
> > Eric
>
> >   On Thu, Oct 22, 2009 at 11:33 AM, Penri <penriwynnjo...@hotmail.com>wrote:
>
> >> We currently have an interface that passes bitmap images of customer
> >> signatures into documents that sit with the document manager in
> >> Tririga (8i - 2.1.9.6). We then have records that have a locator field
> >> that link to those documents so the user can view ths signature but
> >> only by clicking on the link and then clicking download.
>
> >> We're looking to display the the bitmap image directly in the record's
> >> GUI rather than as a link. Could anyone suggest how we can achieve
> >> this?
>
> >> Thanks in advance.- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages