Thursday, April 28, 2011

SSRS Reporting

I recently was asked to figure out to use a more complex security model for reporting in CRM 2011.  The issue is that CRM doesn't have a way of hiding reports from users.  The only choices you have is the security roles that are implemented by the filtered views and by removing the ability for the user to see reports from their roles.  This functionality was not granular enough to meet the security requirement.  To solve the problem I suggested adding an entry to the sitemap that would allow the user access to SSRS reports from inside the CRM application.  We would then use the SSRS security model to get the desired level of granularity.  Here's how I did it:

Edit the site map:

<Area Id="SSRSReports" ResourceId="Area_SSRSReports" Icon="/_imgs/bar_bottom_ico_reports.gif" DescriptionResourceId="SSRSReports_Area_Description" Title ="SSRS Reports">
    <Group Id="Reports" ResourceId="Homepage_SSRSReports" DescriptionResourceId="Homepage_SSRSReports" >
        <Titles>
            <Title Title="Reports" LCID="1033" />
        </Titles>
        <SubArea Id="report_link" ResourceId="report_link_resource" DescriptionResourceId="Reports_SubArea_Description" Icon="/_imgs/bar_bottom_ico_reports.gif" Url="http://crm2011/reports" AvailableOffline="false">
            <Titles>
                <Title Title="SSRS Reports: Accounts" LCID="1033" />
            </Titles>
          </SubArea>
          <SubArea Id="report_link2" ResourceId="report_link_resource2" DescriptionResourceId="Reports_SubArea_Description" Icon="/_imgs/bar_bottom_ico_reports.gif" Url="http://crm2011/reports" AvailableOffline="false">
            <Titles>
                <Title Title="SSRS Reports: Contacts" LCID="1033" />
            </Titles>
        </SubArea>
    </Group>
</Area>

The above xml will add a new entity to the lower left hand corner of the menu.  It will allow users to browse to the SSRS reports.  To edit the sitemap you need to add it to a solution, export the solution, open the .zip, remove the customizations.xml file and make the appropriate edits.  To import the changes put the customizations.xml file back into the .zip and import into CRM.  See this link for more details on the finer points of importing/exporting changes to the sitemap.  If you have users that you don't want to see this link you'll need to apply the appropriate 'Privilege' tag.  See this link for more details.  The tag would allow you to suppress the account subarea for all users unless they had account read privileges.    

Here's a screen shot of the SSRS reports added to the lower left hand corner:


Here's a screen shot of what the user would see once they click the 'SSRS Reports' link:


You can now use the SSRS security model to manage the report permissions to a much more ganular level.  See this link for more details.

Cheers...

No comments:

Post a Comment