Wednesday, April 19, 2006

 

Using the SharePoint Lists extension on Reporting Services 2005

I'm back! Had a great time in Egypt, had a first rank look at the total solar eclipse on March 29th. I feel like going to work again....

So, let's start with something that has been requested a few times during my vacation: how about using the Reporting Services extension for SharePoint Lists on SSRS 2005? I received some reports from people that it didn't "just work", so I installed SSRS 2005 myself and gave it a try.

The bad news is that it seems to be impossible to use the old version of the extension on the new SSRS version. I don't know why, but I had to recompile the sources against the new framework and new interfaces library. Mind you: I did not change one line of code, just recompiled. The new binaries are available for download:

Old version for SQL2000 with source code
New version for SQL2005, only binaries (but the source is the same)

Installation instructions

In SQL2005, some of the configuration details have changed, so here follows a brand new installation manual for the 2005 version.

Copying the binaries

First step is to copy the compiled binaries to the folders where the reporting server and report designer expect to find them. For the report designer (the functionality you use inside Visual Studio) this is the folder:
C:\Program Files\Microsoft SQL Server\MSSQL.4\Reporting Services\ReportServer\bin
Note the folder MSSQL.4: the 4 indicates the SqlServer instance that is used by reporting services. With SQL2005, you will often have multiple instances. Look for the one containing the Reporting Services folder.
For the reporting server, you copy the binaries to:
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies
This is a different location from the SQL2000 setup. In many development environments, you will have both the designer and the reporting server running on one machine. In these cases, you copy the binaries to both places.

Registering the extension

Now we have to let the designer and server know about the extension. For the designer, you edit the file:
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\RSReportDesigner.config

You have to add two lines to this file, one to the <Data> block and one to the <Designer> block. Here we show the result, but you have to add only the last lines of each block. For the server, you'll have to make and edit to the file
C:\Program Files\Microsoft SQL Server\MSSQL.4\Reporting Services\ReportServer\rsreportserver.config
In this file, only the <Data> block needs to be modified (indentical to the change described above). The resulting block looks like this (the last line has been added):

Trusting the extension

For using the extension from the report designer in Visual Studio, you are ready now, but to run the extension from deployed reports on the server, we need one more step: the extension needs to be trusted. This is done by adding an XML block in the file:
C:\Program Files\Microsoft SQL Server\MSSQL.4\Reporting Services\ReportServer\rssrvpolicy.config
With these setup steps, you should be ready to use SharePoint lists as the datasource for your reporting services reports.

Labels:


Comments:
Thx its working great. I have one question: how do you retrieve the user information? The query list=User Information does not work. Any idea's?
 
I think, technically, User Information is not a list. It is sometimes presented in the UI as such, but it isn't. Of course, you could change the code of the extension to also expose user info for reports (and what about usage data?), but I will not implement this myself. Feel free to do so yourself though.
 
Teun, Everythings is working fine except for one thing: the moment a want to add some subscriptions to the reports, and the email is generated, i get the following error:

ReportingServicesService!processing!e!6/1/2006-11:17:08:: e ERROR: An exception has occurred in data source 'Sharepoint'. Details: Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Query execution failed for data set 'Sharepoint'. ---> System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessPermission.Demand()
at System.Diagnostics.ListenerElementsCollection.GetRuntimeObject()
at System.Diagnostics.TraceInternal.get_Listeners()
at System.Diagnostics.TraceInternal.WriteLine(String message)
at System.Diagnostics.Debug.WriteLine(String message)
at Macaw.ReportingServices.SharepointListExtension.Command.ExecuteReader(CommandBehavior behavior)
at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.RuntimeDataSetNode.RunDataSetQuery()
The action that failed was:
Demand
The type of the first permission that failed was:
System.Security.Permissions.SecurityPermission
The first permission that failed was:

IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Flags="UnmanagedCode"/>

The demand was for:

IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Flags="UnmanagedCode"/>

The granted set of the failing assembly was:

PermissionSet class="System.Security.PermissionSet"
version="1">

IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Flags="Execution"/>

IPermission class="System.Security.Permissions.UrlIdentityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Url="file:///C:/Program Files/Microsoft SQL Server/MSSQL.3/Reporting Services/ReportServer/bin/Macaw.ReportingServices.SharepointListExtension.DLL"/>

IPermission class="System.Security.Permissions.ZoneIdentityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Zone="MyComputer"/>
/PermissionSet>

The assembly or AppDomain that failed was:
Macaw.ReportingServices.SharepointListExtension, Version=1.0.2300.18248, Culture=neutral, PublicKeyToken=null
The method that caused the failure was:
Microsoft.ReportingServices.DataProcessing.IDataReader ExecuteReader(Microsoft.ReportingServices.DataProcessing.CommandBehavior)
The Zone of the assembly that failed was:
MyComputer
The Url of the assembly that failed was:
file:///C:/Program Files/Microsoft SQL Server/MSSQL.3/Reporting Services/ReportServer/bin/Macaw.ReportingServices.SharepointListExtension.DLL

Any thoughts on this?
 
@wisent: This is a typical Code Access Security eror message. Apparently, the process that does the scheduled delivery of reports does not use the same CAS settings as does the report server itself. I have personally not tested with mailing reports, so I don't have a ready answer. If you figure it out, please let me know.
You have to find the executable that handles the scheduled reporting and see if it has some sort of policy file (like the rssrvpolicy.config file we updated).
 
Teun,

Thanks for the code for SSRS 2005.
I followed all the steps, registered the DLL as prescribed, I created a report in Visual Studio but I always get the following error message on the web-side report manager:

An error has occurred during report processing. (rsProcessingAborted) Get Online Help
An attempt has been made to use a data extension 'SPSLIST' that is not registered for this report server. (rsDataExtensionNotFound) Get Online Help

Please let me know the resolution.

Thanks in advance.
Ajay
 
@Ajay: The edit that is required in rsreportserver.config should be performed on your reporting server, not only on the development machine.
Hope that helps.
 
Hi Teun,

I tried to install the extension on RS2005, everything works until I actually want to make a new datasource.
I set the site=http://server/sites/sitename, I cannot set credentials for the connection, button is gray, and when I click next, I get the following error:
A connection cannot be made to the database.
Set and test the connection string.
The data extension SPSLIST could not be loaded. Check the configuration file RSReportDesigner.config.

What am I doing wrong?
 
Hi Teun,

I have the same error as wisent.

ReportingServicesService!processing!e!6/1/2006-11:17:08:: e ERROR: An exception has occurred in data source 'Sharepoint'. Details: Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Query execution failed for data set 'Sharepoint'. ---> System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Any solution avialable for scheduling sharepoint reports with report included?
 
Nice work Teun. It's a life saver ;-)
For all those doing a "copy and paste" operation on the config settings, note that you have to add a trailing slash to close the config entries or the XML will not be valid.
Another thing, the credentials, in my case, had to be entered in the format username@domain as opposed to domain\username.

Just my 2 cents.
 
Hey Teun,
I have installed your data extension in both location (designer + server) and i can created/preview reports through visual studio but when i deploy the reports to the server and run them i get the error:
"An error has occurred during report processing. (rsProcessingAborted)". Do you have any idea of what i may be doing wrong? I'm using RS2005 and i am using your latest RS2005 data extension.
Any help would be great. Thanks.
 
To many of the people who encounter problems when deploying the solution to their server: most of the times the 'Cannot create a data reader for data set' error message is caused by Code Access Security settings. It is the part called "trusting..." above and also described here:
http://dotnetjunkies.com/WebLog/teund/archive/2005/06/14/121258.aspx
 
Teun

Just got it all working to the screen where it would have allowed for selection of different tables and lists. However none are coming up on my screen. Do you have to manually add SQL to this version?

Thanks
 
Has anyone determined an answer to the following problem -- getting this message when configuring the Datasource in Visual Studio>

"A connection cannot be made to the database.
Set and test the connection string.
The data extension SPSLIST could not be loaded. Check the configuration file RSReportDesigner.config."

I'm pretty darn sure I've followed everything posted here to the letter, though obviously I'm missing something... Thanks for anyhelp
 
I am also getting the error "There is an error in the query. Object reference not set to an instance of an object." although I feel like I have tried everything to fix it.

I am using WSS 3.0, SRS 2005, VS2005 all on same machine.

Connection string:
site=http://sp2007.phase2int.com
Query String:
list=Tasks;

I have also tried credentials with the @ and the \...

Has anyone been able to fix this issue, as I see it more than once in these various blogs

Thanks
 
I am also getting the similar error i.e "There is an error in the query. Object reference not set to an instance of an object."

SRS and sharepoint are in different servers.

Connection string:
site=http://msrecordsdev/sites/DMS/MSImmigration/
Query String:
list=Tasks;

Can you please let me know how to fix this issue?
 
Dear all,

I am sorry, but I currently don't have time nor the development environment available to look into this.
This may change in the near future, but I cannot promise this. Sorry for now.

However, the most up-to-date version of my sources is available for download, so anyone who feels like it can sort out this problem. Feel free.
 
Hi
I am also having the object reference problem -

"There is an error in the query. Object reference not set to an instance of an object."

SRS and sharepoint are in different servers.

Connection string:
site=http://ermssp2007/
Query String:
list=Tasks;


Has anyone found a solution to this yet?

Thanks.
 
The text for updateing the .config files is wrong.

You need to close each of the the single lines with a "/>" instead of just ">".

The codegroup also needs to be clsoed with a "/codegroup" (include the brackets, the comment for won't let me put them) which is ommitted.
 
I am getting "There is an error in the query. Object reference not set to an instance of an object." when I try to hit next on the "design the query" screen. my query is simply "list=Hours" (without the quotes)
 
OK,OK, you are all correct: there was a nasty issue with reporting over WSS3 and MOSS2007. I fixed it now and improved the error messaging (which was horribly meaningless). Check http://www.teuntostring.net/blog/2007/08/finally-fixed-problem-w-reporting-over.html
 
Has a solution to this error been found/identified?

ReportingServicesService!processing!e!6/1/2006-11:17:08:: e ERROR: An exception has occurred in data source 'Sharepoint'. Details: Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Query execution failed for data set 'Sharepoint'. ---> System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessPermission.Demand()
at System.Diagnostics.ListenerElementsCollection.GetRuntimeObject()
at System.Diagnostics.TraceInternal.get_Listeners()
at System.Diagnostics.TraceInternal.WriteLine(String message)
at System.Diagnostics.Debug.WriteLine(String message)
at Macaw.ReportingServices.SharepointListExtension.Command.ExecuteReader(CommandBehavior behavior)
at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.RuntimeDataSetNode.RunDataSetQuery()
The action that failed was:
Demand
The type of the first permission that failed was:
System.Security.Permissions.SecurityPermission
The first permission that failed was:

IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Flags="UnmanagedCode"/>

The demand was for:

IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Flags="UnmanagedCode"/>

The granted set of the failing assembly was:

PermissionSet class="System.Security.PermissionSet"
version="1">

IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Flags="Execution"/>

IPermission class="System.Security.Permissions.UrlIdentityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Url="file:///C:/Program Files/Microsoft SQL Server/MSSQL.3/Reporting Services/ReportServer/bin/Macaw.ReportingServices.SharepointListExtension.DLL"/>

IPermission class="System.Security.Permissions.ZoneIdentityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Zone="MyComputer"/>
/PermissionSet>

The assembly or AppDomain that failed was:
Macaw.ReportingServices.SharepointListExtension, Version=1.0.2300.18248, Culture=neutral, PublicKeyToken=null
The method that caused the failure was:
Microsoft.ReportingServices.DataProcessing.IDataReader ExecuteReader(Microsoft.ReportingServices.DataProcessing.CommandBehavior)
The Zone of the assembly that failed was:
MyComputer
The Url of the assembly that failed was:
file:///C:/Program Files/Microsoft SQL Server/MSSQL.3/Reporting Services/ReportServer/bin/Macaw.ReportingServices.SharepointListExtension.DLL

I can be reached at Brian.Smith@qts.com
 
Teun,

I think you have wrong.
For Report Server we need to copy the binary to
C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\bin

And for Report Designer we need to copy the binary to C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies

The code snippet you provided missing the end slash ("/")
Extension Name="SPSLIST" Type="Macaw.ReportingServices.SharepointListExtension.Connection,Macaw.ReportingServices.SharepointListExtension" />

BTW, Nice work.

Thanks,
Hieu
 
Hi Teun,
Thanks for the great blog it is really helpful. I did all the steps and after that when I tried to create a Report Project using VS 2005 Report Project wizard, it is giving me the following error.

The configuration file RSReportDesigner.config could not be loaded. The report server has encountered a configuration error.

Thanks for your help in advance.

Regards,
Kalyan Guin
 
Try opening the config file in an XML aware editor, like Visual Studio. It is probably malformed.
 
Post a Comment

Links to this post:

Create a Link



<< Home

This page is powered by Blogger. Isn't yours?