Omnis Technical Note TNWE0013 September 2006

Displaying Pictures in a Web Datagrid

For Omnis Studio 4 or above
By Andreas Pfeiffer

Sometimes you may want to display pictures in the Web Client in a list. For this purpose you can use the Omnis Datagrid web component. The $columntype of the datagrid column in which you want to display the picture should be set to kDataGridAutoData and the picture should be stored in the Omnis list in CS24 format.

JPEGs and bitmaps can be converted with the Omnis function Pictconfto() before you add the picture field to the list data. You can use the following Omnis method to load JPEGs, convert to CS24 format, and add them to your list:

ReadBinFile(con(lLibDir,'toolbar.jpg'),Ipicture)
Do pictconvto('JPEG',iPicture,'CS24') Returns iPicture
Do iList.$add('toolbar',iPicture)
ReadBinFile(con(lLibDir,'orb.bmp'),iPicture)
Do pictconvto('BMP',iPicture,'CS24') Returns iPicture
Do iList.$add('orb',iPicture)

The resultant Web datagrid would look something like this: