zz: Calculated Columns - Displaying Images from oscar
2008-12-04 22:15
459 查看
Calculated
Columns - Displaying Images
by oscar 12/1/200712: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:
Modify the FLDTYPES.XML file(or make a copy of it!)
Search for the field definition "Calculated"
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
Technorati
Tags: wss 3.0,moss 2007,calculated
Fields,caml
相关文章推荐
- Bash命令行处理[详解]zz fromLinuxSir.Org
- loser们的共同特征 zz from caoz
- How to capture video frames from the camera as images using AV Foundation
- [导入]Produce GIF or PNG barcode images from a Ruby on Rails application using RMagick and Gbarcode
- 关于傅利叶变换的一些数学解释兼及其它(zz from 水源)
- Creating from resource images
- ZZ: 如何禁止掉SharePoint页面个性化? from kaneboy
- How to update multiple columns of one table using values from another table?
- oracle主键自动增长的实现 Oracle Sequence oracle maxid自动生成--ORA-00001: 违反唯一约束条件 (NAME.SYS_C005547)产生的原因之一(select * from all_cons_columns w
- IIS 经典问答[zz from technet]
- EXTRACT FILES AND IMAGES FROM A SHAREPOINT CONTENT DATABASE
- Personal Web Site--Custom handler for fetching images from a database
- gmail 安全检查步骤zz from lihlii
- NPL学习之:分词相关 摘选zz from 52npl`
- Chapter 06-Displaying Data From multiple Tables - 01
- 每日论文 Learning from Simulated and Unsupervised Images through Adversarial Training
- 利用freebsd-update升级freebsd zz from baoz.net
- CRAFT Objects From Images
- [Paper note] Learning from Simulated and Unsupervised Images through Adversarial Training
- 字符编码笔记:ASCII,Unicode和UTF-8[推荐,讲的很清楚][zz from 阮一峰]