PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WEBDEV 2024 → Display an Image in a Table column
Display an Image in a Table column
Débuté par Shahine, 25 avr. 2008 18:55 - 5 réponses
Posté le 25 avril 2008 - 18:55
Hi,

How can I display an image in a table column?
I have a column that is not linked to any fields and its type is Image. I want to be able to set the image depending on the value of other columns.


On the RowDisplay of the table I have:

Table1.Column1..Value = image1..Image

Column1 = My image column in the table
image1 = A hidden image on the form

But this doesn't seem to work? What am I doing wrong?


Many Thanks
Shahine
Posté le 27 avril 2008 - 10:21
Hi Shahine,

Good to meet you (Briefly) at the UKIWDG last week.

I tested it and it works if you use the name of the image file which is stored in the _WEB directory of your project.

Cheers

Bob
Posté le 27 avril 2008 - 16:50
Hi Bob

Thanks for the answer. I was using the full path and it wasn't working.
As soon as I just put the name of the png file it work.

Thanks for the help.


ps. I really enjoyed the UKIWDG. I thought it was very useful.
Thanks for arranging it.


Cheers

Shahine
Posté le 30 avril 2008 - 12:47
Hi, I've got the same problem, how can I show an image that is not on the root of the site, but for example is on another shared path ?
Thank you
Posté le 27 juin 2008 - 00:53
hi
If you know something it(he,she) brings over of this problem you make to me it know thank you

Giovanni Galimberti escribir un mensaje de news <481831c3$1@news.pcsoft.fr> :


Hi, I've got the same problem, how can I show an image that is not on the root of the site, but for example is on another shared path ?
Thank you
Posté le 26 août 2008 - 00:44
Hi all...

To display an image in a table depending on other columns conditions, just assign the image name (the image must be somewhere inside the "_WEB" directory)...

IF COL_DueDate > Today() THEN
COL_Image = "bad.gif"
ELSE
COL_Image = "good.gif"
END


If you have an image in other place, away from the "_WEB" directory, they you will need to apply a little trick with AWP.

1) Create a new page, with any style, this page will never be displayed. Name it "file.wwh".

2) On the page description check the "Generation in AWP mode" option, this will allow us to call the page without context.

3) On the "Initialization" section of the page type in:

sSharedDirectory is string = "C:/Shared"

sOutputFile is string = PageParameter("name")

sLocalFile is string = sSharedDirectory + ["/"] + sOutputFile

FileDisplay(sLocalFile)


4) Change the value of "sSharedDirectory" to the path to your shared directory, remember to change the "\" for "/" and avoid the last one.

5) Since the file will be called in AWP mode, we just assign the file to the column:

COL_Image = "UK/file.awp?name=image.gif"


Where:

* "UK" is the Nation (it can be ES, FR, or other, depending on your language settings)

* "file.awp" is the page file.wwh but in AWP mode. If you named the page "myfile.wwh", then this will need to be changed to "myfile.awp".

* "image.gif" is the name of the file inside the shared directory.


As you can see, the page "file.wwh" works as a proxy to access the files in our shared directory.


You can use this on non-columns images like this:

IMG_Image1 = "UK/file.awp?name=random_banner_updated_by_other_system.gif"




Hope this helps!


Hilario Perez Corona
Nabu Tecnologia en Software