Tuesday, March 3, 2009

Dataview DataSource not showing all files...

Ran into a situation today where a Dataview web part was showing some of the items in a Library but not all... It turns out that by default the datasource only shows files and folders at the top level. All of the items that are inside of folders or subfolders will not get returned.

The solution is to go to the 'Scope' parameter of your tag and change it to 'RecursiveAll'. This will cause your query to return all items regadrless of folder level from the data source. One thing to note, if your list or library is a Very Large List you need to be careful to set your 'Filter' parameters before changing the tag to 'Recursive' (Shows all files of all folders) or 'RecursiveAll' (Shows all files and all subfolders of all folders); in our case we were doing a dataform for a very large list so we set the Filter to ID = . If you are creating your DataSource in SPD and you don't set your Filter before changing the Scope to Recursive there is a good chance SPD will time out and/or crash trying to preview your data.

More info on Data Source configuration here: http://office.microsoft.com/en-us/sharepointdesigner/HA101326861033.aspx (just note that they are changing their data source properties BEFORE they add it to the page, this will run you into the timeout issue I described above for Very Large Lists so remember to add it to the page and edit the Scope by hand in Code View).

1 comment:

Ely said...
This comment has been removed by the author.