You may need to display data-dependent images in a page. A common example is to display a picture of a stock item. Another example might be to highlight certain data conditions in a lengthy report by displaying images within the data.
To do this you use ReportMate to output the HTML syntax for the picture. Fortunately the syntax for a picture is fairly short and simple.
Displaying a variable picture on a page (such as a catalog picture)
In this situation you have two options:
Put the picture HTML syntax in your template and make only the file name be a variable that comes from ReportMate
syntax in the template is <img src="path/variablefilename">
variablefilename is a variable that you extract via ReportMate from a field or construct from another field (such as using the stock number for the file name and appending a ".jpg" or ".gif" extension).
Put the entire HTML syntax as a variable that comes from ReportMate
entire syntax is entered in RM format as <img src="path/datafield">
datafield is the field that contains the file name (such as the image field in the stock record)
this approach has the advantage of being able to test to see if an image is defined (such as seeing if the image field is blank) and not outputting any of the image syntax unless the file is defined. With the first approach your page will show a broken picture link if no file is available for a particular record.
See the ReportMate format NLSTKDET for an example.
Displaying images within records in a ReportMate list
This approach allows you to conditionally display an image when certain data conditions exist. ReportMate tests the data conditions and uses its conditional print feature to control whether to output the HTML syntax for the picture.
Let's say you want to make it easier to spot past due A/R open items in a list of customer open items. You have a small icon named "clock.bmp" that you have put in your NetLink images directory and you want to display this next to the amount field on any open item that is late. Beside the amount field (within the same column) you could insert the following literal into your RM format:
Make sure the literal has at least one space on each side of it so that it is considered one literal. For that literal use the ReportMate print selection criteria feature to print the literal only if:
Current system date > Due date
Balance > 0
When ReportMate outputs each record for the NetLink page it will include the picture syntax for the clock image if the open item is late and has a balance greater than zero. When you look at your page in the browser the clock image will appear for each record that needs attention.