Monday, March 12, 2012

Reports + Setup

Hi,

I need to create a setup project that will create a new folder in the Reports Server.

The folder should contain all the reports I have developed.

The folder should have a browse permission for a user that I will choose (from the Active Dir.).

Everything must be programaticlly. In other words, I need to create a folder and set the permissions for it using code.

Is there a way? Do you have something in mind?

10x,

Solved it using the followings:

for the folder creation part:

_service = new ReportingService2005();

_service.Credentials = System.Net.CredentialCache.DefaultCredentials;

_service.CreateFolder(directoryName, "/", null);

for the security part:

Role role = new Role();

role.Name = "Browser";

Policy policy = new Policy();

policy.Roles = new Role[] { role };

policy.GroupUserName = domain + @."\user";

_service.SetPolicies("/" + directoryName, new Policy[] { policy });

I hope this will help you guys..

No comments:

Post a Comment