Archive for the ‘Data View Webpart’ Category

Ever wondered why you get this message when you insert a DataView in a page using SharePoint Designer??
Everything seems fine while you see the design mode of the page in the designer, but shows the text message in the page as An error occurred processing the data view. The XslText property is empty.

The actual problem was that I had accidentally inserted another empty data view, which when removed, the page worked fine. So click only once when inserting a data view.

When ever we create a view for a list there will be a section called Totals. We can use this section to calculate & display the total of the items in the list. This will be useful to display totals particularly when you use group-by.If you notice, you will be seeing some column names with a drop-down nearby with option “Count”. If you select this the count will be based on this column. But if you are having a calculated column in your list, it will not be displayed here. So in this case we need to create a data view web part using designer. In this case you can do total and other operations like sum etc..

  1. First create a Data view web part and apply grouping if needed (check this post).
  2. Don’t forget to select “Show Group Footer” in the Sort & group properties.
  3. Now you will get the data view displaying the list with totals for each group (as in above picture with count).
  4. If you notice the code related to count is Count : <xsl:value-of select=”count($nodeset)” />

Now I am having another column Man Hours in my list which is of Type Number. I want t0 display the sum of man hours for each group (in my case for each location i need to find the total man hours).

To do so I just replace Count : <xsl:value-of select=”count($nodeset)” /> with Total Man Hours : <xsl:value-of select=”sum($nodeset/@Man_x0020_Hours)” />

Now my list view looks like

You can notice Total Man Hours displaying total man hours for each location. You can try more functions other than Sum 🙂

When you try to export the contents of a list to an excel, things would seem to start working, but then Excel would pop up an error: “Cannot get the list schema column property from the SharePoint list”.

Searching over the internet I got to know its due to the presence of DateTime field in SharePoint which when exported to excel raises a mismatch in data type.  To solve this issue I found 2 ways

  1. Remove the DateTime field from the view you want to export to excel. if you really t want those date columns, then you have to try step 2.
  2. Convert the date field to a single line of text.  Then, convert it back to a date. It was nice to see that the conversion worked, actually.  It was quite nervous that converting things this way would fail, but it did not.

Another way I found is creating a new page, placing a Data View webpart (A fine article on creating Data View Web Part) in at with the data source as your list. This will display all the items in your list. Now open this page in the browser, right click & select Export to excel.