Flokkaskjalasafn: Gögn Skoða Web Part

Samanburður dagsetningar í Data View Web Part Til Byggja a WSS KPI

Athugaðu: this was first posted at www.endusersharepoint.com hér: HTTP://www.endusersharepoint.com/2009/11/02/comparing-dates-in-a-data-view-web-part-to-build-a-wss-kpi-in-sharepoint/.

Þetta er enn annar blogg á að bera saman dagsetningar í XSL í gögnum skoða vefur hluti í SharePoint.

Þetta er atburðarás minn:

  • Ég hafa a siðvenja lista.
  • The business purpose of the list is to support the idea of a new employee and his/her tasks to be completed within 7 days of starting the job.
  • They are in a “warning zone” after 4 days if they have not completed these tasks.
  • I want to create a simple dashboard that shows green when they have either completed the task or if they have more than 4 days to complete it.
  • I want the dashboard to show yellow if they are in the warning zone.
  • I want to to show red if they have not completed the task after the due date.

I borrowed from þessi grein á Marc Anderson’s blogg (http://mdasblog.wordpress.com/2008/02/19/comparing-dates-in-sharepoint-using-xsl/) to get the comparison logic and þessi grein á www.endusersharepoint.com for the basic ideas behind the dashboard (http://www.endusersharepoint.com/2008/12/09/visual-indicators-for-the-masses-kpis-in-wss/) written by Toni Frankola.

You should read the supporting blogs, but the implementation goes like this:

  1. Búa gerð efnis (columns + CT)
  2. Create a custom list and associate it with the content type.
  3. Create a web part page.
  4. Add the custom list to the web part page.
  5. Open up the page in SPD.
  6. Convert the list to a DVWP.
  7. Modify the XSL to generate the dashboard bits.

I have two dates: a warning date and a due date. To compare the dates, my xsl does the following:

 
 <XSL:velja>
 
 <!-- When both handbook and policy are signed, we are green regardless of dates. -->
 <XSL:þegar próf="@Employee_x0020_Handbook_x003F_ = 1 and @Security_x0020_Policies = 1">
 <IMG src="/_layouts/images/KPIDefault-0.GIF" gamall="No problems"/>
 <a href="/HumanResources/Lists/New Employee Checklist/EditForm.aspx?ID={@ ID}&magnara;Source=/HumanResources/Shared Documents/New Hire Dashboard.aspx"> [Edit]</a>
 </XSL:þegar>
 
 <!-- Show amber indicator if we're past the warning date. -->
 <XSL:þegar próf="ddwrt:FormatDateTime(band(ddwrt:Í dag()), 1033, 'yyyyMMdd') &GT;= ddwrt:FormatDateTime(band(@TaskDueDate), 1033, 'yyyyMMdd')">
 <IMG src="/_layouts/images/KPIDefault-2.GIF" gamall="Overdue"/>
 <a stíl="border: 0px" href="/HumanResources/Lists/New Employee Checklist/EditForm.aspx?ID={@ ID}&magnara;Source=/HumanResources/Shared Documents/New Hire Dashboard.aspx"> [Edit]</a>
 </XSL:þegar>
 
 <!-- Show red indicator if we're passed the due date. -->
 <XSL:þegar próf="ddwrt:FormatDateTime(band(ddwrt:Í dag()), 1033, 'yyyyMMdd') &GT;= ddwrt:FormatDateTime(band(@Warning_x0020_Date), 1033, 'yyyyMMdd')">
 <IMG src="/_layouts/images/KPIDefault-1.GIF" gamall="Warning"/> 
 <a href="/HumanResources/Lists/New Employee Checklist/EditForm.aspx?ID={@ ID}&magnara;Source=/HumanResources/Shared Documents/New Hire Dashboard.aspx"> [Edit]</a>
 </XSL:þegar>
 
 <!-- If we get here, we're earlier than the warning date, so we're green. -->
 <XSL:annars>
 <IMG src="/_layouts/images/KPIDefault-0.GIF" gamall="No problems"/>
 <a href="/HumanResources/Lists/New Employee Checklist/EditForm.aspx?ID={@ ID}&magnara;Source=/HumanResources/Shared Documents/New Hire Dashboard.aspx"> [Edit]</a>
 </XSL:annars>
 
 </XSL:velja>

A few key points from above:

  • I tried to compare dates without using the ddwrt functionality and got nowhere. I still don’t understand that. They dates displayed correctly, but both “>” and “<” comparisons always failed. Í lok, ddwrt came to my rescue (takk, aftur, Marc).
  • I’m also displaying an [Edit] 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.
  • This is implemented in SharePoint online and works nicely.
  • The images I reference in the _layouts directory (/_layouts/images/KPI…) are available out of the box in my environment so they are probably available for you as well.

Here’s a screen shot of what it looks like for me:

image

</enda>

Gerast áskrifandi að bloggið mitt.

Fylgdu mér á Twitter á http://www.twitter.com/pagalvin

Fljótur og Þægilegur: Búa til Data View Web Part (DVWP)

Það er mikið af mikill upplýsingar á WSS 3.0 Gögn Skoða Web Part (DVWP) on the web from several sources. Hins, I found it to be surprisingly difficult to find information on this first very basic step. Here is another article in the "quick and easy" röð til að takast það.

Follow these steps to create a data view web part (DVWP). They are based on an "Announcements" web part, but apply to most lists.

  1. Create an Announcements web part and add it to a site.
  2. Open the site in SharePoint Designer.
  3. Open the site’s default.aspx.
  4. Select the Announcements web part and right-click.
  5. From the context menu, select "Convert to XSLT Data View".

SharePoint Designer notifies you that this site is now customized from its site definition. That’s not necessarily bad, but there are important implications (performance, upgrade, aðrir) which are beyond the scope of this little "Quick and Easy" færslu. To get more information on this subject, I recommend both books hér as well as your favorite Internet search.

Confirm that you did it correctly:

  1. Close and re-open the web browser (to avoid accidentally re-posting the original "add a new web part").
  2. Select the web part’s arrow drop-down and choose "Modify Shared Web Part" from the menu.
  3. The tool panel opens to the right.
  4. The panel has changed from its usual set options to this:
mynd