Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Linked Source in SharePoint Designer

  Asked By: Carlos    Date: Sep 26    Category: Sharepoint    Views: 1534

I'm going to be quite specific here as I have tried for ours to solve
this and so far had no luck. I have a list of projects and a list of
project tasks (a lookup column exists linked to the projects list). I
want to show, using a data view web part, the list of projects with a
couple of extra columns showing the count of Project Tasks for the
project and the percentage of these that have been completed.

I am able to create a linked source and show the fields from the
Project list but cannot get the count of tasks and percentage
completed. I got close with this as a calculated column using XPath:

count(//project tasks/rows[@Project='Test Project'])

(or something very similar)
however this only returns the count for a hardcoded project. Once I
replaced this with @title it broke.

Anyone have any ideas how to do this?



1 Answer Found

Answer #1    Answered By: Brooke Lewis     Answered On: Sep 26

Not quite sure if that's what you are after. I assume that you've
created a join between you list.
The following should get you started.
Create a new data  form web  part and choose some attributes from the
master (projects) and insert them as multiple items. This gives you a
list with your projects  (guess that's where you are at the moment).

When done decide, where you want to include the detail information (e.g.
create a new colum or new row), choose some attributes from the child
(project tasks) and choose Insert Selected Fields As Joined subview.
This will give you an option to determine the join field.
If you look at the source  code SPD produces you'll see a new XSLT
template dvt_2 with some variables defined at the top.
<xsl:variable name="dvt_ParentRow" select="current()" />
<xsl:variable name="Rows"
select="../../../Tasks/Rows/Row[@Project=$dvt_ParentRow/@Title]" />

If you are not interested in showing  the task details, but only count
them you can modify this template to reflect your needs.

<xsl:variable name="dvt_ParentRow" select="current()" />
<xsl:variable name="CountTasks"
<xsl:value-of select="$CountTasks" />

Didn't find what you were looking for? Find more on Linked Source in SharePoint Designer Or get search suggestion and latest updates.