How to total a column of values in a Sharepoint DVWP

By peter.stilgoe









To total a column of values in a Sharepoint DVWP use:

<xsl:value-of select="sum(/dsQueryResponse/Rows/Row/@TotalHoursWorked)" />

To do something similar in Xpath with formatting:

format-number(sum(/dsQueryResponse/Rows/Row/@TotalHoursWorked), '#,##0.00;-#,##0.00')




Share

Leggi tutto

How to display a URL in a DVWP using the XSLT ‘substring’ function

By peter.stilgoe









The code below will use the URL held in View_x005F_x0020_Flow but will only use the URL part before the comma

ie original URL

www.petestilgoe.com/&=testing,testing123

<a href="{substring-before(@View_x005F_x0020_Flow, ',')}">View Flow</a></td></tr>

URL after using the above code is:

www.petestilgoe.com/&=testing

Share

Leggi tutto

Sharepoint DVWP: How to remove the group name when grouping items

By peter.stilgoe









When you create a DVWP & group your items, by default it will group them like this:

Grouped By Name:Specific Item

ie. +Matter_Number: 9999986

If you want the group title to just display the specific item name

ie +9999986

View your Dataview Webpart in code view & remove the following four lines of code:

<b>
<xsl:value-of select="$fieldtitle" />
</b>
<xsl:if test="$fieldtitle">: </xsl:if>

Share

Leggi tutto

SPDataSource Cross List Data View – Roll up all tasks across site collection

By peter.stilgoe









Add the following code to your Data View webpart (tbc)

<SharePointWebControls:SPDataSource runat="server" DataSourceMode="CrossList" SelectCommand="<Webs Scope='Recursive'></Webs><Lists ServerTemplate='107'</Lists><Query /><ViewFields><FieldRef Name='Title' /><FieldRef Name='Status' /><FieldRef Name='PercentComplete' /><FieldRef Name='Matter_x0020_Number' /><FieldRef Name='Task_x0020_KPI' /></ViewFields><QueryOptions />" UseInternalName="True" UseServerDataFormat="True" ID="dataformwebpart1"><SelectParameters><WebPartPages:DataFormParameter ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="{470C3D07-87CE-4FFD-908B-A59223155B15}" Name="ListID"></WebPartPages:DataFormParameter><asp:Parameter DefaultValue="0" Name="StartRowIndex"></asp:Parameter><asp:Parameter DefaultValue="0" Name="nextpagedata"></asp:Parameter><asp:Parameter DefaultValue="10" Name="MaximumRows"></asp:Parameter>

Share

Leggi tutto

Sharepoint CAML query encoder decoder

By peter.stilgoe









A useful tool to encode and decode your Sharepoint CAML queries.

Use the CAML encoder and decoder to encode or decode CAML while working with SharePoint Data Source Control queries. This script utilizes both HTML rendering to decode and a PHP function to encode.

Sharepoint CAML query Encoder & Decoder

Share

Leggi tutto

DVWP How to remove duplicate entries in filter dropdown list

By peter.stilgoe









When displaying the filter bar in a data view webpart it will list multiple instances of the same option if the data exists multiple times in your datasource ie. say you have a 100 list items & one of the columns contains a ‘yes’ or ‘no’, it will list them 100 times instead of just a single ‘yes’ / ‘no’ option to apply on your filter.

To remove duplicate filter options, open your dataview webpart in Sharepoint Designer & look for:

Simply remove the ‘[1]‘ from each filter option, now your filter dropdowns will only display unique values, removing the duplicate options.




Share

Leggi tutto

Displaying HTML in the Dataview Webpart (DVWP)

By peter.stilgoe









If you try & display rich html columns or any other columns that uses HTML in a DVWP it will display as the actual HTML as opposed to outputting it as HTML formatted text.

If you added your data using Sharepoint designer “Insert Selected Fields” you need view your DVWP code in SPD & search for:

xsl:value-of select=”@MyHTMLFormattedColumn”

and replace it with

xsl:value-of disable-output-escaping=”yes” select=”@MyHTMLFormattedColumn”

Now your data in this column will display as you expected ie. formatted with the HTML code applied.

Note: In SPD 2010 you will need to convert your DVWP to XSLT, On the ribbon:

List View Tools –> Design –> Customize XSLT

Share

Leggi tutto

How to make the filter choices display by default in the DVWP

By peter.stilgoe









When configuring your DVWP in SPD you can choose to enable filter options, however you have to click the filter button in order to display the filter options. If you want the filter options to display by default when you open the page with the DVWP all you need to do is to remove the following line from the DVWP webpart code:

Below this line of code you will see all the filter fields that you can filter data on by default, if you want to limit what you users can filter on you can just remove the various lines of code for each filter.

Share

categoriaSharepoint DVWP commento6 Comments dataJune 25th, 2010
Leggi tutto

An error occurred processing the data view. The XslText property is empty

By peter.stilgoe









If you are getting the error:

‘An error occurred processing the data view. The XslText property is empty’

You have probably inserted an extra dataview on your page, check your page & remove the extra data view you accidentally inserted & your error will go away.

Share

Leggi tutto