mrc Documentation
michaels, ross & cole, ltd.
http://www.mrc-productivity.com/

 


Displaying Images in Servlet Applications

 

At times, you may have files that contain images, which you would like to display in your web application. This is easily achieved by following the steps described below.

 

The following example of a multiple record retrieval assumes that you have .jpg files in the /mrcjava/image directory. In our case the Product number is also the name of the file used to identify each image of the product. So Product A1000 also has a file named A1000.jpg in /mrcjava/image

 

Note: While this example relates to a multiple record retrieval, the same steps should be followed for single record retrievals, all types of maintainers and reports.

 

 

1. Create a calculation to store the location of the image for the current product

 

 

 

 

 

2. Click the Preformat link from the Application Options screen and code an ‘I’ in the User Defined Control Field for the calculated field, which happens to be the location and file name of the photo. The “I” indicates to the servlet to create an image rather than simply displaying the path of the image in text.

 

 

 

At run time, the output will look like this: