CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Al

Print topic Send  topic

Author Message
Allen Patrick
Posted: 01/16/2004, 9:15 AM

I have Grid that displays a Material Type. These material types are numbered 1 through 15 and are displayed on the page. However I would like to have them displayed as icons with corresponding tooltips. For instance Material type 1 is a "Book" So I would like to show a book icon with a tooltip of "Book". Material type 2 is "Music" so I would like to display an icon of a Compact Disk with a tooltip of "Music". And so on. Can anyone tell me the way I can do this in codecharge studio?
Thanks
Nicole

Posts: 586
Posted: 01/17/2004, 7:41 AM

Allen,
You need additional table that stores the material_type_id and path to icon (icon_path). In addition to it all the icons should be on server.
Then on the form open data source and join main table and mentioned additional table on material_type_id.
Use Image control assigned to icon_path instead of material_type_id.

_________________
Regards,
Nicole
View profile  Send private message
JCF
Posted: 01/17/2004, 9:05 AM

Hi

This is what I have done on a file upload page, this changes the icon to
type of file. Such as Word, PDF, Zip, Jpg, gif, etc.

The swich condition calculates the just the last part of the file name
'.jpg' for example.

The rest of the code change the image to the correct image for that file
type.

switch (strrchr($web_docs->doc_name->GetValue(), "."))
{
case ".jpg":
$web_docs->Image2->SetValue("jpg.jpg");
break;
case ".ppt":
$web_docs->Image2->SetValue("ppt.jpg");
break;
case ".html":
$web_docs->Image2->SetValue("html.jpg");
break;
case ".htm":
$web_docs->Image2->SetValue("htm.jpg");
break;
case ".bmp":
$web_docs->Image2->SetValue("bmp.jpg");
break;
case ".doc":
$web_docs->Image2->SetValue("doc.jpg");
break;
case ".file":
$web_docs->Image2->SetValue("file.gif");
break;
case ".gif":
$web_docs->Image2->SetValue("gif.jpg");
break;
case ".gz":
$web_docs->Image2->SetValue("gz.jpg");
break;
case ".bin":
$web_docs->Image2->SetValue("bin.gif");
break;
case ".link":
$web_docs->Image2->SetValue("link.jpg");
break;
case ".mag":
$web_docs->Image2->SetValue("mag.jpg");
break;
case ".mdb":
$web_docs->Image2->SetValue("mdb.jpg");
break;
case ".move":
$web_docs->Image2->SetValue("move.gif");
break;
case ".mp3":
$web_docs->Image2->SetValue("mp3.jpg");
break;
case ".pdf":
$web_docs->Image2->SetValue("pdf.jpg");
break;
case ".tar":
$web_docs->Image2->SetValue("tar.jpg");
break;
case ".xls":
$web_docs->Image2->SetValue("xls.jpg");
break;
case ".zip":
$web_docs->Image2->SetValue("zip.jpg");
break;
default:
$web_docs->Image2->SetValue("file.jpg");
break;
}

This same procedure could be done for each row in a browse - in the before
show event.

JCF

"Nicole" <Nicole@forum.codecharge> wrote in message
news:5400957c51e817@news.codecharge.com...
> Allen,
> You need additional table that stores the material_type_id and path to
icon (icon_path). In addition to it all the icons should be on server.
> Then on the form open data source and join main table and mentioned
additional table on material_type_id.
> Use Image control assigned to icon_path instead of material_type_id.
>
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>


Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.