惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
CERT Recently Published Vulnerability Notes
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
WordPress大学
WordPress大学
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
V
Visual Studio Blog
Stack Overflow Blog
Stack Overflow Blog
aimingoo的专栏
aimingoo的专栏
C
Check Point Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
T
Tor Project blog
P
Proofpoint News Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Latest news
Latest news
L
LINUX DO - 热门话题
罗磊的独立博客
T
Tenable Blog
The Hacker News
The Hacker News
美团技术团队
N
Netflix TechBlog - Medium
V
Vulnerabilities – Threatpost
阮一峰的网络日志
阮一峰的网络日志
Last Week in AI
Last Week in AI
博客园 - 司徒正美
Jina AI
Jina AI
Cyberwarzone
Cyberwarzone
云风的 BLOG
云风的 BLOG
S
Secure Thoughts
Cloudbric
Cloudbric
S
Security @ Cisco Blogs
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Microsoft Security Blog
Microsoft Security Blog
Spread Privacy
Spread Privacy
U
Unit 42
雷峰网
雷峰网
C
CXSECURITY Database RSS Feed - CXSecurity.com
Webroot Blog
Webroot Blog
爱范儿
爱范儿
博客园 - 【当耐特】
Know Your Adversary
Know Your Adversary
P
Privacy International News Feed
P
Palo Alto Networks Blog
Google Online Security Blog
Google Online Security Blog
The Last Watchdog
The Last Watchdog
博客园 - 聂微东
Help Net Security
Help Net Security
Hacker News: Ask HN
Hacker News: Ask HN
F
Full Disclosure
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
S
Security Affairs
Project Zero
Project Zero

博客园 - yier

ZZ:修改sharepoint文档库文件类型显示图标(PDF,WinRAR) ZZ: How to remove 'Open in Windows Explorer' from the 'Actions Menu' zz: 如何查询SQL Server数据库的版本 zz: 关闭WIN2003关机事件跟踪程序 zz:MOSS內容資料庫的分配與管理 zz:CAML簡介 zz:全局化定制MOSS樣式 zz:貼幾個常用的MOSS樣式選擇器 ZZ:SharePoint常用目录介绍 ZZ:如何修改默认的site template大小 ZZ:JMeter使用指南 ZZ: Moving or Renaming the WSS Central Administration Content Database zz: 如何移動已存在的SQL Server 2005中的user database Search settings - Authentication failed because the remote party has closed the transport stream - yier zz:如何更改列表项前的New标记的天数设置(days-to-show-new-icon ) from Jianyi ZZ: Uploads with SharePoint 2007 - Antivirus From Eric Cherng zz: SharePoint 2007 Folders from Eric Cherng [原创] 在dos命令行里面取当天是“星期几" ZZ: 如何禁止掉SharePoint页面个性化?(续) from kaneboy
zz: Calculated Columns - Displaying Images from oscar
yier · 2008-12-04 · via 博客园 - yier

Calculated Columns - Displaying Images

12/1/2007 12:51:00 PM

Recently, I was working on a project that required the  creation of an IT Project Management Site Template.  I thought, hmm, pretty straight forward, but wait, I ran into an issue that I am positive, could have been solved in other ways (List Event Handler)

The requirement was to display an image based on a certain condition, and this condition had to do with lookup of other List Column values. 

If you want to display images for a calculated column here are the steps you need to take:

  1. Modify the FLDTYPES.XML file(or make a copy of it!)
  2. Search for the field definition "Calculated"
  3. On the default rendering pattern, paste the following <Switch>
    <Expr>
    <GetFileExtension><Column/></GetFileExtension>
    </Expr>
    <Case Value="giF">
    <HTML><![CDATA[<IMG SRC="]]></HTML><Column HTMLEncode="TRUE"/><HTML>"</HTML>
    </Case>
    <Default>
    <Column HTMLEncode="TRUE" AutoHyperLink="TRUE"
    AutoNewLine="TRUE"/>
    </Default>
    </Switch>

    Create a new Column of type Calculated - put some logic in it like so

    =IF(AND(Impact="3",Probability="1"),"/_layouts/images/KPIDefault-1.giF",
    IF(AND(Impact="3",Probability="2"),"/_layouts/images/KPIDefault-2.giF",
    IF(AND(Impact="3",Probability="3"),"/_layouts/images/KPIDefault-2.giF",
    IF(AND(Impact="2",Probability="1"),"/_layouts/images/KPIDefault-1.giF",
    IF(AND(Impact="2",Probability="2"),"/_layouts/images/KPIDefault-1.giF",
    IF(AND(Impact="2",Probability="3"),"/_layouts/images/KPIDefault-2.giF",
    IF(AND(Impact="1",Probability="1"),"/_layouts/images/KPIDefault-0.giF",
    IF(AND(Impact="1",Probability="2"),"/_layouts/images/KPIDefault-0.giF",
    IF(AND(Impact="1",Probability="3"),"/_layouts/images/KPIDefault-1.giF","other")))))))))

    NOTE: The Impact and Probability are columns in the SharePoint List.  Based on this logic, I am re-using the images from the KPIs in MOSS and simply pointing to them.

    And that's it!   You now can output images for your List.  Here is how it looks

      

posted on 2008-12-04 22:15  yier  阅读(331)  评论()    收藏  举报