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

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