Thursday, March 02, 2006
Update: Reporting over Sharepoint lists from MS Reporting Services
About 6 months ago, I published an article about writing a reporting services data extension to query lists in Sharepoint sites. The article focussed mainly on "how to extend MS Reporting Services", but from the many responses I received, I reckon that many people are building production solutions around the sample presented in that article. As a matter of fact: I did so myself. I created a number of reports for the team sites we use in our projects at Macaw. Every now and then, I had the need for extra functionality in the extension itself.
I decided to publish this enhanced version to the public. A few warnings in advance: this is free software, it comes with source code, but I do not take any responsibility for the quality of the software oor for any damage caused by the use of it. This is still a sample and may not be fit for production environments.
First of all: the code and binaries of the Macaw.ReportingServices.SharepointListExtension can be downloaded here. Installation and configuration procedures are exactly identical to the former version of the extension.
Now on to the new functionality. All of the new features can be configured throught the query string box of the (the box that you would normally use to enter the SQL query of your report)..
Reporting on views
In the old version, the query string of the dataset could only specify a list name. Filtering and sorting would be specified by the default view of that list. In the new version, you can use the query string to specify an existing view for the list. The sorting and filtering of this view will be reflected in the dataset in the report. Specifying a view for your query is easy as this: Note that the different settings are separated by semicolons as you would normally see in a database connection string. In the previous version, the list would be identified by entering the list name as the query string (without the list= part). You can still do this for backward compatibility, but the "right" format is now list=ListName.If you specify no view at all, instead of getting the default view, you will now get the full table: all fields and all rows.
Stripping HTML from multiline fields
Many people use multi line texts in their lists. Even if you do not allow the addition of links and markup (bold/italic), SharePoint stores the content of these fields as HTML. It will contain <div> tags. In a normal Reporting Services report, these tags will show up visibly. With the new striphtml parameter, you can have the extension remove any HTML markup from the multi-line fields before returning the data for rendering the report.Charting changes in Issue lists over time
In Sharepoint, when you base your list on the Issues templates, the list will keep track of historic data. This allows you to see which changes have occurred to the list item and when (and by whom). When you want to create a report on the current state of the list, that's fine, but sometimes it is interesting to get insights in the history of the list, answering questions like "How did the number of active issues with severity high change over time?". To do this, I created a new parameter that you can set: When you do this, the resulting dataset get an extra field (GridDate). For each day, the dataset is filled with copies of all items that existed at that date (with the values they had on that date). This means that the dataset can grow very large if the changes span a long period. But it also allows you to create charts like this:
Just create an Area chart, use
The siteUrl parameter
You still specify the Url of the WSS site containing your data in the connection string of your datasource. However, if you want to use the same report for many sites (with identical lists and views), you may want to specify the site Url as a parameter. This also allows you to make a web part that shows a specific report querying the current site. The parameter will automatically show up when you use the data extension in your report. When you leave the parameter blank, the value from the datasource connection string will be used.Labels: reporting services
I get Metadata file ... MicrosoftReportingServices.Interface.dll could not be opened -- Version 2.0 is not a compatible version. Any ideas?
@anonymous: That's not a pretty error message. Sorry 'bout that. Try specifying a view name as well?
list=Task; view=All Tasks;
list=Resource; view=All Resources;
Then have a report that gets all data from both views?
I hope so...
What is (sadly) not possible in Sharepoint is to join to lists together to one view. There are certainly situations where this would be desirable, but I cannot help you there.
I fixed the problem with domain accounts not working by changing the GetCredential to have this code:
If (conn.IntegratedSecurity) Then
Return CredentialCache.DefaultCredentials
Else
Dim sUser As String = ""
Dim sDomain As String = ""
sUser = conn.GetUserName
If sUser.Contains("\") Then
sDomain = sUser.Split("\")(0)
sUser = sUser.Split("\")(1)
Return New NetworkCredential(sUser, conn.GetPassword, sDomain)
Else
Return New NetworkCredential(sUser, conn.GetPassword)
End If
End If
I don't like that solution however as it is specific to a single report and highly fragile. It would however solve you problem.
Its work wonderful in Visual Studio .Net
But after deploying on the report server and looking reports from the report manager
i get this error:
Reporting Services Error
An error has occurred during report processing. (rsProcessingAborted)
Cannot create a data reader for data set 'RequestDate'. (rsErrorCreatingDataReader)
How to solve this problem?
But when I use the striphtml=true flag, it seems to add a space character before each line in the multiple-line field. The first line is the only one which is fine.
Thanks for any idea on how to handle this!
Is it possible to query the content of the XML documents in a form library, and not just the list column data (not all data may be displayed as columns in a view)?
We have developed a data extension for reporting services that makes it possible to pass reporting services parameteters, combine lists using Sql-like operators and some other features.
I have to admit that the initial idea came from your article. We had a real need for reporting over sharepoint data.
Though your exention is fine we needed much more features and this turned into a project by itself. We decided to make it a commercial software.
An evaluation version is available on our web site (http://www.enesyssoftware.com).
I you consider this comment has nothing to on your blog, please don't hesitate to delete it.
Regards,
to fix: change command.cs
line "XmlNode ItemsNode = lists.GetListItems(TechListName, TechViewName, query, fields, "", null);" to "XmlNode ItemsNode = lists.GetListItems(TechListName, TechViewName, query, fields, "1000000", null);" -- sets rowcount. Also for SQL server 2005, no report designer folder -- instead C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies
Great solution Teun!
Of course, if you use the same view for on-screen viewing as well, you may want to create a special view only for reporting purposes that has a very high page limit.
The server I am using: windows 2003, SQL 2005, WSS 3.0, .net framework 3.0.
i had the same problem as a poster above:
Reporting Services Error
An error has occurred during report processing. (rsProcessingAborted)
Cannot create a data reader for data set 'RequestDate'. (rsErrorCreatingDataReader)
then i followed the instructions on modifying rssrvpolicy.config and it's working!
I keep getting this error message for the query: "There is an error in the query. Object reference not set to an instance of an object."
i modified the rsreportserver.config and rssrvpolicy.config in the folder C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer. i loaded an existing report and after tweaking the datasource a bit, it ran fine.
however, i can't get visual studio 2005 to recognize the SPSLIST data extension. anyone figured this out?
Great Solution! But I'm getting the same error: "There is an error in the query. Object reference not set to an instance of an object."
Can not get what I'm doing wrong. I've followed all instructions. Any help is much appreciated. Thanks, Zam
I only have one question: sometimes I have columns in my Sharepoint library which consists of more than 255 characters.
Unfortunately I only get 255 characters in my reports. Is there a way that I can show more than 255 characters on my sharepoint column in my report.
Thank you very much for your help
Regards, Karsten
"The application for project 'C:\MyFiles\SPDataExtension\Macaw.ReportingServices.SharepointlistExtension.csproj' is not installed" I check that directory, the file is there. Any ideas? Thanks...
You are an absolute star for sharing your work. I have started from your code and been able to do exactly what I wanted.
Wonderful stuff.
Many thanks!!!
Etienne
Can anyone help me out?
Links to this post:
<< Home



