Kumbuka: hii ndiyo ya kwanza posted katika www.endusersharepoint.com hapa: http://www.endusersharepoint.com/2009/11/02/comparing-dates-in-a-data-view-web-part-to-build-a-wss-kpi-in-sharepoint/.
Hii ni baada ya mwingine blog juu ya kulinganisha tarehe za XSL katika sehemu ya data mtazamo mtandao katika SharePoint.
Hii ni hali yangu:
- Nina orodha desturi.
- madhumuni ya biashara katika orodha hii ni kusaidia wazo la mfanyakazi mpya na kazi yake / zake na kukamilishwa katika 7 siku ya kuanza kazi.
- Wao ni katika "ukanda wa onyo" baada ya 4 siku kama si kumaliza kazi hizi.
- Nataka kujenga dashibodi rahisi kwamba inaonyesha kijani wakati wao aidha kumaliza kazi au kama wana zaidi ya 4 siku kukamilisha.
- Nataka dashibodi kuonyesha njano kama ni katika ukanda wa onyo.
- Nataka kuonyesha nyekundu kama si kumaliza kazi baada ya tarehe kutokana.
Mimi zilizokopwa kutoka makala hii katika Marc Anderson ya blog (http://mdasblog.wordpress.com/2008/02/19/comparing-dates-in-sharepoint-using-xsl/) kupata mantiki ya kulinganisha na makala hii katika www.endusersharepoint.com kwa ajili ya mawazo ya msingi nyuma ya dashibodi (http://www.endusersharepoint.com/2008/12/09/visual-indicators-for-the-masses-kpis-in-wss/) Imeandikwa na Toni Frankola.
Unapaswa kusoma blogs kusaidia, lakini utekelezaji unaendelea kama hii:
- Kujenga aina ya maudhui (nguzo + CT)
- Kutengeneza orodha ya desturi na kujiunga pamoja na aina ya maudhui.
- Kujenga sehemu mtandao ukurasa.
- Kuongeza orodha ya desturi na ukurasa sehemu ya mtandao.
- Kufungua ukurasa katika SPD.
- Kubadilisha orodha ya DVWP.
- Kurekebisha XSL kuzalisha bits dashibodi.
Mimi na tarehe mbili: a warning date and a due date. To compare the dates, xsl yangu anafanya zifuatazo:
<xsl:kuchagua> <!-- Wakati wote na sera ya kitabu ni sahihi, sisi ni kijani bila kujali tarehe. -->
<xsl:wakati mtihani="@Employee_x0020_Handbook_x003F_ = 1 na @ Security_x0020_Policies = 1"> <img src="/_layouts/images/KPIDefault-0.GIF" zamani="No problems"/> <a href="/HumanResources/Lists/New Employee Checklist/EditForm.aspx?ID ={@ ID}&Amp;Chanzo = / HumanResources / Pamoja Nyaraka / New Hire Dashboard.aspx"> [Hariri]</a> </xsl:wakati> <!-- Kuonyesha kaharabu kiashiria kama tupo nyuma tarehe ya onyo. -->
<xsl:wakati mtihani="ddwrt:FormatDateTime(string(ddwrt:Leo()), 1033, 'YyyyMMdd') >= Ddwrt:FormatDateTime(string(@ TaskDueDate), 1033, 'YyyyMMdd')"> <img src="/_layouts/images/KPIDefault-2.GIF" zamani="Overdue"/> <a style="border: 0px" href="/HumanResources/Lists/New Employee Checklist/EditForm.aspx?ID ={@ ID}&Amp;Chanzo = / HumanResources / Pamoja Nyaraka / New Hire Dashboard.aspx"> [Hariri]</a> </xsl:wakati> <!-- Kuonyesha kiashiria nyekundu kama sisi ni kupita kutokana tarehe. -->
<xsl:wakati mtihani="ddwrt:FormatDateTime(string(ddwrt:Leo()), 1033, 'YyyyMMdd') >= Ddwrt:FormatDateTime(string(@ Warning_x0020_Date), 1033, 'YyyyMMdd')"> <img src="/_layouts/images/KPIDefault-1.GIF" zamani="Warning"/> <a href="/HumanResources/Lists/New Employee Checklist/EditForm.aspx?ID ={@ ID}&Amp;Chanzo = / HumanResources / Pamoja Nyaraka / New Hire Dashboard.aspx"> [Hariri]</a> </xsl:wakati> <!-- Kama tutapata hapa, sisi ni mapema zaidi ya tarehe ya onyo, hivyo sisi ni kijani. -->
<xsl:vinginevyo> <img src="/_layouts/images/KPIDefault-0.GIF" zamani="No problems"/> <a href="/HumanResources/Lists/New Employee Checklist/EditForm.aspx?ID ={@ ID}&Amp;Chanzo = / HumanResources / Pamoja Nyaraka / New Hire Dashboard.aspx"> [Hariri]</a> </xsl:vinginevyo> </xsl:kuchagua> |
chache muhimu pointi kutoka juu:
- I tried to compare dates without using the ddwrt functionality and got nowhere. I still don’t understand that. They dates displayed correctly, lakini wote wawili ">"Na"<” comparisons always failed. Katika mwisho, ddwrt alikuja kuniokoa (shukrani, tena, Marc).
- Mimi pia kuonyesha [Hariri] link to the item. I mainly did this so that I could easily test this out. The link itself may be useful to someone trying to figure it out.
- Huu utatekelezwa katika SharePoint online na kazi nicely.
- images mimi rejea katika saraka _layouts (/_layouts / images / KPI ...) zinapatikana nje ya boksi katika mazingira yangu ili pengine inapatikana kwa ajili yenu pia.
Hapa ni risasi screen ya nini inaonekana kama kwa ajili yangu:
</mwisho>
Kufuata yangu juu ya Twitter kwa http://www.twitter.com/pagalvin