Showing posts with label trouble. Show all posts
Showing posts with label trouble. Show all posts

Tuesday, March 20, 2012

Custom Security Extensions for SQL RS 2005

Hi,

I'm having a lot of trouble trying to set up a custom security extension with Reporting Services 2005. Following the VB example from McGraw Hill Osborne (http://www.mhprofessional.com/product.php?cat=112&isbn=0072262397&cat=112), I've compiled the .dll for the extension and made the changes to the ReportManager and ReportServer .config files. After I reset IIS and return to the RS website, it displays "The report server has encountered a configuration error..." and I get a message in my System Event log:

The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID
{BA126AD1-2166-11D1-B1D0-00805FC1270E}
to the user MYMACHINE\ASPNET SID (S-1-5-21-1708537768-839522115-1343024091-1005). This security permission can be modified using the Component Services administrative tool.

Wondering if anyone else has had similar trouble and how did they get around it?

Have you modified the RSSrvPolicy.config ?

Here is a guide I followed to successfully implement custom authentication in RS.

http://msdn2.microsoft.com/en-us/library/ms160724.aspx

Look at the section "To modify the RSSrvPolicy.config file"

Regards Andreas|||

Here are the changes I made to .config files before running Reporting Services and getting these errors:

Under the ReportManager directory:

rsmgrpolicy.config - MyComputer code group permission from Execution to FullTrust

rsWebApplication.config - modified <UI> entry, added redirection to login page + URL

Web.config - identify impersonate -> "false"

Under the ReportServer dierctory:

RSReportServer.config - Added <Extension> elements with Name ="Forms" inside both <Security> and <Authentication>

rssvrpolicy.config - added new <CodeGroup> block just under CodeGroup with "$CodeGen$" string

web.config - identify impersonate -> "false"

sql

Sunday, March 11, 2012

Custom Query Designer

Hi,
I'm having some trouble with implementing my own Query Designer.
I have built a control that implements the IQueryDesigner Interface
and register it in the RSReportDesigner.config file.
However Visual Studio never calls it. When I click on the Generic Query
Designer Button to switch between the Generic Designer an my Custom Designer,
The Designer window simply Reads
"The Query could not be loaded."
"Verify your connection string and query string."
I have tried attaching the debugger and I can break on the other Data
Extension classes I have implemented. So it appears that Studio is erring
before it gets to loading my Control. Everything else works fine if I run it
through the generic query designer.
I have also tried uninstalling and reinstalling Reporting Services thinking
the Designer may be broken, but this hasn't helped.
Unless someone has a better Idea, I'm going to resort to reinstalling visual
studio.
Any Ideas?
Thanks
Adrian B.Testing the Query Designer Code on another machine has not helped. So
re-installing Visual Studio will pointless.
I am currently at a loss for where to go with this.
Does anyone have any ideas at all?
Adrian B.

Thursday, March 8, 2012

Custom Grouping Problem

I am having some trouble with grouping. I have a custom function that returns the field to group on depending on the parameters provided by the user. This is not working, however if I select the same value from the grouping drop down list that is returned by the custom function the grouping works. My custom funtion is as follows:

Function OrganisationGroup() As String
Dim Group As String
Group = ""
Select Case Report.Parameters!EnterpriseOption.Value
Case "1"
Group = Group1Value()
Case "2"
Group = "DepartmentDesc"
Case "3"
Group = "OrganizationDesc"
Case "4"
Group = "OrganizationDesc"
End Select

If Group = "" Then
Return "0"
Else
Return "Fields!" & Group & ".Value"
End If
End Function

Function Group1Value() As String
Dim Group As String
Group = ""
Select Case Report.Parameters!ReportType.Value
Case "1"
Group = "StockFamilyDesc"
Case "2"
Group = "GroupDesc"
Case "3"
Group = "Saleable"
Case "4"
Group = "Saleable"
Case "5"
Group = "SaleableGLCodeDesc"
Case "6"
Group = "Saleable"
End Select
Return Group
End Function

Does anyone have any ideas on why the grouping would not be working with the custom function?

Thanks in advance.
I have solved the problem myself. The following changes to the custom code fixed the problem.

Function Group1Value() As String
Dim Group As String
Group = ""
Select Case Report.Parameters!ReportType.Value
Case "1" Group = "StockFamilyDesc"
Case "2" Group = "GroupDesc"
Case "3" Group = "Saleable"
Case "4" Group = "Saleable"
Case "5" Group = "SaleableGLCodeDesc"
Case "6" Group = "Saleable"
End Select
Return Group
End Function

Now is ...

Function Group1Value(fields As Fields) As String
Dim Group As String
Group = ""
Select Case Report.Parameters!ReportType.Value
Case "1" Group = fields!StockFamilyDesc.Value
Case "2" Group = fields!GroupDesc.Value
Case "3" Group = fields!Saleable.Value
Case "4" Group = fields!Saleable.Value
Case "5" Group = fields!SaleableGLCodeDesc.Value
Case "6" Group = fields!Saleable.Value
End Select
Return Group
End Function

Similar changes in Function OrganisationGroup()

Custom Grouping Problem

I am having some trouble with grouping. I have a custom function that returns the field to group on depending on the parameters provided by the user. This is not working, however if I select the same value from the grouping drop down list that is returned by the custom function the grouping works. My custom funtion is as follows:

Function OrganisationGroup() As String
Dim Group As String
Group = ""
Select Case Report.Parameters!EnterpriseOption.Value
Case "1"
Group = Group1Value()
Case "2"
Group = "DepartmentDesc"
Case "3"
Group = "OrganizationDesc"
Case "4"
Group = "OrganizationDesc"
End Select

If Group = "" Then
Return "0"
Else
Return "Fields!" & Group & ".Value"
End If
End Function

Function Group1Value() As String
Dim Group As String
Group = ""
Select Case Report.Parameters!ReportType.Value
Case "1"
Group = "StockFamilyDesc"
Case "2"
Group = "GroupDesc"
Case "3"
Group = "Saleable"
Case "4"
Group = "Saleable"
Case "5"
Group = "SaleableGLCodeDesc"
Case "6"
Group = "Saleable"
End Select
Return Group
End Function

Does anyone have any ideas on why the grouping would not be working with the custom function?

Thanks in advance.
I have solved the problem myself. The following changes to the custom code fixed the problem.

Function Group1Value() As String
Dim Group As String
Group = ""
Select Case Report.Parameters!ReportType.Value
Case "1" Group = "StockFamilyDesc"
Case "2" Group = "GroupDesc"
Case "3" Group = "Saleable"
Case "4" Group = "Saleable"
Case "5" Group = "SaleableGLCodeDesc"
Case "6" Group = "Saleable"
End Select
Return Group
End Function

Now is ...

Function Group1Value(fields As Fields) As String
Dim Group As String
Group = ""
Select Case Report.Parameters!ReportType.Value
Case "1" Group = fields!StockFamilyDesc.Value
Case "2" Group = fields!GroupDesc.Value
Case "3" Group = fields!Saleable.Value
Case "4" Group = fields!Saleable.Value
Case "5" Group = fields!SaleableGLCodeDesc.Value
Case "6" Group = fields!Saleable.Value
End Select
Return Group
End Function

Similar changes in Function OrganisationGroup()

Saturday, February 25, 2012

Custom Data Ext. Query Editor trouble

I created a custom data extension for reporting services in C#.
The CDE implements a dataset with one datatable now but I can't get it to
display in the query editor in the data tab of the report designer.
Any ideas on what needs to be done to expose it and additional data tables
to the query editor for some easy point and click query building?
thanksHave you added to required entries into the RSReportDesigner.config and
RSReportServer.config?
"paul" wrote:
> I created a custom data extension for reporting services in C#.
> The CDE implements a dataset with one datatable now but I can't get it to
> display in the query editor in the data tab of the report designer.
> Any ideas on what needs to be done to expose it and additional data tables
> to the query editor for some easy point and click query building?
> thanks|||Thanks for the reply.
I did add the necessary entries to the rsreportdesigner.config file.
For viewing the report in VS2005 though, both in the data and preview panes,
I'm not sure why I'd need to add any entries to the rsreportserver.config
file?
"SvdSinner" wrote:
> Have you added to required entries into the RSReportDesigner.config and
> RSReportServer.config?
> "paul" wrote:
> > I created a custom data extension for reporting services in C#.
> >
> > The CDE implements a dataset with one datatable now but I can't get it to
> > display in the query editor in the data tab of the report designer.
> >
> > Any ideas on what needs to be done to expose it and additional data tables
> > to the query editor for some easy point and click query building?
> >
> > thanks

Sunday, February 19, 2012

Custom Authorization user confusion

hi,
I have read a lot of other posts here about using custom Forms
Authentication, but am still having trouble comprending some points. I
understand the custom authentication piece (LogonUser) and understand how
CheckAccess() works.
Its setting up users that confuses me. Do users have to be defined and
assigned roles with ReportManager? (My users are defined in a custom
database)
If I don't use ReportManager, how can I (programmatically) create users
dynamically and associate these users with a newly defined role? I know I
can use the CreateRole() method for to define a new role - just don't see any
methods that deal with users.
I assume there has to be a way because (again another assumption) I think
ReportManager uses the same interfaces available to me (through the
ReportingService class).
Thanks,
Matt> Its setting up users that confuses me. Do users have to be defined and
> assigned roles with ReportManager? (My users are defined in a custom
> database)
The users can be defined in any datastore. In this case, it's your
database.
> If I don't use ReportManager, how can I (programmatically) create users
> dynamically and associate these users with a newly defined role?
You develop some process to create users. ReportManager doesn't create
users. For example, your application may have a Manage Users screen.
Using Forms Auth you can assign roles to users. For example, the below
function takes a username (valid user from your data store) and a
Report Server folder. Then it assigns the user the Browser role. So if a
valid user in your database is 'TestUser' and you want to add 'TestUser' as
a Browser to 'TestFolder'...
AddUserToFolderPolicy("TestFolder", "TestUser", ref string errMessage)
private bool AddUserToFolderPolicy(string folder, string user, ref string
errMessage)
{
try
{
//Get the Browser role
Role[]roles = m_ReportingService.ListRoles();
Role browserRole = new Role();
foreach (Role r in roles)
{
if (r.Name == "Browser") browserRole = r;
break;
}
Role[] policyRoles = new Role[1];
policyRoles[0] = new Role();
policyRoles[0] =browserRole;
//Get the current policies of the folder in question
string path = "/" + folder;
bool inheritParent = false;
Policy[] currentPolicies = m_ReportingService.GetPolicies(path, out
inheritParent);
//If the user is currently in the current policy set just return
for(int i=0;i<currentPolicies.Length;i++)
if(currentPolicies[i].GroupUserName == user)
return true;
//Create the new policy array and add the new user
ArrayList arrPolicies = new ArrayList(currentPolicies);
Policy p = new Policy();
p.GroupUserName = user;
p.Roles = policyRoles;
arrPolicies.Add(p);
Policy[] finalPolicies = (Policy[])arrPolicies.ToArray(typeof(Policy));
//Set the policies
m_ReportingService.SetPolicies(path,finalPolicies);
}
catch (Exception e)
{
errMessage = e.Message;
return false;
}
return true;
}
HTH|||Yes, this helps - so I can set access to folders by using the SetPolicies()
method. This makes sense now. The user doesn't already have to be defined
in ReportManager, it can be any name (that makes sense - in this case a name
from my user database). And you're right about the ReportManager - I went
back and now I see it works in exactly the same way. This was the missing
piece for me.
I assume I can follow the same procedure for individual reports (and linked
reports) - I just have to specify the full path to the report.
Thanks for your help.
Matt
"FNDS" wrote:
>
> > Its setting up users that confuses me. Do users have to be defined and
> > assigned roles with ReportManager? (My users are defined in a custom
> > database)
> The users can be defined in any datastore. In this case, it's your
> database.
> >
> > If I don't use ReportManager, how can I (programmatically) create users
> > dynamically and associate these users with a newly defined role?
> You develop some process to create users. ReportManager doesn't create
> users. For example, your application may have a Manage Users screen.
> Using Forms Auth you can assign roles to users. For example, the below
> function takes a username (valid user from your data store) and a
> Report Server folder. Then it assigns the user the Browser role. So if a
> valid user in your database is 'TestUser' and you want to add 'TestUser' as
> a Browser to 'TestFolder'...
> AddUserToFolderPolicy("TestFolder", "TestUser", ref string errMessage)
>
> private bool AddUserToFolderPolicy(string folder, string user, ref string
> errMessage)
> {
> try
> {
> //Get the Browser role
> Role[]roles = m_ReportingService.ListRoles();
> Role browserRole = new Role();
> foreach (Role r in roles)
> {
> if (r.Name == "Browser") browserRole = r;
> break;
> }
> Role[] policyRoles = new Role[1];
> policyRoles[0] = new Role();
> policyRoles[0] =browserRole;
> //Get the current policies of the folder in question
> string path = "/" + folder;
> bool inheritParent = false;
> Policy[] currentPolicies = m_ReportingService.GetPolicies(path, out
> inheritParent);
> //If the user is currently in the current policy set just return
> for(int i=0;i<currentPolicies.Length;i++)
> if(currentPolicies[i].GroupUserName == user)
> return true;
> //Create the new policy array and add the new user
> ArrayList arrPolicies = new ArrayList(currentPolicies);
> Policy p = new Policy();
> p.GroupUserName = user;
> p.Roles = policyRoles;
> arrPolicies.Add(p);
> Policy[] finalPolicies = (Policy[])arrPolicies.ToArray(typeof(Policy));
> //Set the policies
> m_ReportingService.SetPolicies(path,finalPolicies);
> }
> catch (Exception e)
> {
> errMessage = e.Message;
> return false;
> }
> return true;
> }
> HTH
>
>|||There is a vocabulary clarification to make. The roles are merely RS roles
(browser, content manager, etc.) that specify sets of permissions. If you
want to have user groups, for what is commonly called "role-based security",
you need to modify the Forms Authentication sample code to support both
users and groups (in CheckAccess, IsValidPrincipal, etc.), and you maintain
the groups alongside the users in your security database -- completely
outside reporting services. Then, you can assign Forms Auth groups to RS
roles as well, just like you do with Windows Authentication.
--
Cheers,
'(' Jeff A. Stucker
\
Business Intelligence
www.criadvantage.com
---
"mshumaker" <mshumaker@.discussions.microsoft.com> wrote in message
news:772301D2-6836-4219-A40B-23DDFB562A9E@.microsoft.com...
> hi,
> I have read a lot of other posts here about using custom Forms
> Authentication, but am still having trouble comprending some points. I
> understand the custom authentication piece (LogonUser) and understand how
> CheckAccess() works.
> Its setting up users that confuses me. Do users have to be defined and
> assigned roles with ReportManager? (My users are defined in a custom
> database)
> If I don't use ReportManager, how can I (programmatically) create users
> dynamically and associate these users with a newly defined role? I know I
> can use the CreateRole() method for to define a new role - just don't see
> any
> methods that deal with users.
> I assume there has to be a way because (again another assumption) I think
> ReportManager uses the same interfaces available to me (through the
> ReportingService class).
> Thanks,
> Matt
>|||Hi,
Was reading through thiis post. I am trying this out currently. m_ReportingService is the webService right? If so, I am getting an error " ListRoles() take 0 Arguements"!
Am I missing something
From http://www.developmentnow.com/g/115_2005_1_0_0_454650/Custom-Authorization-user-confusion.ht
Posted via DevelopmentNow.com Group
http://www.developmentnow.com

Friday, February 17, 2012

Custom Assembly accessing files on another server

I am having trouble wth my custom assembly being able to access files that
are not on the same server as the reporting services web service. It works
perfectly for files on the same server.
I am not sure what permissions need to be set up on the folder on the server
that I need to access. I know that asp.net required me to create a domain
user account and then impersonate that account in the web.config file. I
would then be able to access resources as long as the domain user that was
being impersonated had access to it.
So in RS am not sure if there is a similar strategy or how to do it. I was
unable to find documentation on this.
Could someone help explain ths to me?
Thanks...Your code will be called under account of the user running the report.
"Dan" <prefernotto@.say.nope> wrote in message
news:eOqZajZWEHA.1128@.TK2MSFTNGP10.phx.gbl...
> I am having trouble wth my custom assembly being able to access files that
> are not on the same server as the reporting services web service. It
works
> perfectly for files on the same server.
> I am not sure what permissions need to be set up on the folder on the
server
> that I need to access. I know that asp.net required me to create a domain
> user account and then impersonate that account in the web.config file. I
> would then be able to access resources as long as the domain user that was
> being impersonated had access to it.
> So in RS am not sure if there is a similar strategy or how to do it. I
was
> unable to find documentation on this.
> Could someone help explain ths to me?
> Thanks...
>
>