Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Collapse the table of content
Expand the table of content
Expand Minimize

ReportingService2010.CreateRole Method (String, String, String[])


Adds a new role to the report server database. This method only applies to native mode.

Namespace:   ReportService2010
Assembly:  ReportService2010 (in ReportService2010.dll)

	RequestNamespace = "http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
	ResponseNamespace = "http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
	Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
[SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)]
public void CreateRole(
	string Name,
	string Description,
	string[] TaskIDs


Type: System.String

The name of the new role. The value of this parameter must be between 1 and 260 characters long.

Type: System.String

A description of the new role. The value of this parameter must be between 1 and 512 characters long.

Type: System.String[]

An array of task IDs that represent the tasks to set for the role.

The table below shows header and permissions information on this operation.

SOAP Header Usage

(In) TrustedUserHeaderValue

(Out) ServerInfoHeaderValue

Native Mode Required Permissions

CreateRoles (System)

SharePoint Mode Required Permissions

Not supported

This method throws an OperationNotSupportedSharePointMode exception when invoked in SharePont mode.

The Name and Description parameters are required and should not be set to null (Nothing in Visual Basic). The value for Name must be unique.

You must assign at least one task to the role. You cannot combine system-level and item-level tasks within a single role. For more information about tasks, see Tasks and Permissions.

To compile this code example, you must reference the Reporting Services WSDL and import certain namespaces. For more information, see . The following code example uses the CreateRole method to create a user role that has permissions to view folders and reports:317946aa-8e95-4f0b-8170-394c9d5e184e

using System;
using System.Web.Services.Protocols;

class Sample
   public static void Main()
     ReportingService2010 rs = new ReportingService2010();
      rs.Credentials = System.Net.CredentialCache.DefaultCredentials;

         string name = "Report Browser";
       string desc = "View folders and reports.";

         Task[] tasks = rs.ListTasks("All");
         List<string> taskIDs = new List<string>();

         foreach (Task t in tasks)

         rs.CreateRole(name, desc, taskIDs.ToArray());
      catch (SoapException e)
Return to top
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft