Archive for February, 2012

SSRS Error 3: The configuration file contains an element that is not valid. The ReportServerUrl element is not a configuration file element.

My Environment:

1. SSRS 2005 64bit

2. Windows 2008 R2 64bit

3. IIS 7.5

4. After completing the Reporting services set-up, I have got all necessary green mark  on the configuration manager window.

Then I tried to access the Reports url http://localhost/reports and I have got the following error message!

And the Source Error and Stack trace are:

To fix this issue, just follow these steps, the same modification of the “RSWebApplication.config” will solve this issue too.

Advertisements

Leave a comment

SSRS Error 2: The attempt to connect to the report server failed. Check your connection information and that the report server is a compatible version.

After configuring the Reporting Services (SSRS 2005), I tried to access the Report url http://localhost/reports and I have got an error saying “The ReportServerVirtualDirectory element is missing” then I fixed the issue you can check the steps in my previous post. After resolving this issue,  I  could access the ReportManager page but with the following error:

This means that I have configured the Reporting Server but cannot be reachable via http://localhost/ and I tried in several ways to fix this issue and finally end-up with the following solution:

Step 1: Open the “RSWebApplication.config” file in a Notepad or any other editor. (Normally it is located “C:\Program Files\Microsoft SQL Server\MSSQL.X\Reporting Services\Reports” but for me under “D:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportManager”)

Step 2: Check whether <ReportServerUrl> and <ReportServerVirtualDirectory> elements having any values.

Step 3: If  <ReportServerUrl> tag’s element is empty then add the full url of the ReportServer (Not Reports).

Please note: I have tried with server IP, Server Name and localhost, all are working fine for me and if you want to use server name and it ‘s using different port number other than 80, then the ReportServerUrl should be: http://servername:portnumber/ReportServer.

Step 4: If  <ReportServerVirtualDirectory>  tag’s element has any value (for me ReportServer is there, which was added to fix the previous error) then just delete it and leave it empty.

Step 5: Recycle the ReportServer’s App-Pool to reload the “RSWebApplication.config” file. (Just go to the IIS –> Application Pool and click the Recycling on the right hand panel)

That’s all, hope you would get the following page! 🙂

References:

1. http://social.msdn.microsoft.com/Forums/en-HK/sqlreportingservices/thread/530ed56d-7c84-4d13-8998-80a8bf142197

2. http://social.msdn.microsoft.com/forums/en-US/sqlreportingservices/thread/0afd896c-8957-4ec1-b9db-5b4e62eccbc0/

, , , , , ,

2 Comments

SSRS Error 1: An error occurred while parsing the configuration file. The ReportServerVirtualDirectory element is missing

I am installing a 3rd party Auditing Software for our SharePoint 2007 farm and it needs SQL Reporting Services (SSRS) to generates reports. When I was configuring the SSRS 2005 (It is already installed but not configured) on our production server which is having Windows 2008 R2 OS and IIS 7.5. After completing the Reporting services set-up, I have got all necessary green mark on the configuration manager window.

Then I tried to access the Report server http://localhost/reportservers (Normally ReportServer but I configured as ReportServers, you can check the step-bi-step configuration here) and I have got the following page! Great!!

After this I tried to access the Reports url http://localhost/reports and I have got the following wired error message!

And the Source Error and Stack trace are:

I did Google about this and found many suggestios & solutions but this Msdn thread help me to solve this issue, here are the steps:

Step 1: Find out the “RSWebApplication.config”file. (Normally it is located “C:\Program Files\Microsoft SQL Server\MSSQL.X\Reporting Services\Reports” but for me under “D:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportManager”)

Step 2: Check the <ReportServerVirtualDirectory> tag element is empty (Check the error message now “element is missing” no?)

Step 3: If so, just add the ReportServer  value in the ReportServerVirtualDirectory tag.

That’s all, we are safe and this problem solved, but you might be getting an other error message at this point (I have resolved this here).

I don’t really know why this element is missing, while configuring “Web Service Identity” it should be added in the config file. Anyway this is a known issue but I wanted to keep for my future reference and this UI steps would save some time of yours too.

References:

1. http://social.msdn.microsoft.com/forums/en-US/sqlreportingservices/thread/48a1e733-1a47-4c79-b01e-d84fafa779b4/

2. http://www.sqlservercentral.com/Forums/Topic697167-146-1.aspx#bm697180 

, , , , , , , ,

1 Comment

You do not have permissions to open this file on Excel Services OR Excel cannot load the workbook that you requested –SharePoint 2007

One of my colleagues sent an error message while using the development site of SharePoint 2007 in my office and I figured out the configuration of “Excel Calculation Services” was not done properly. It’s a very simple set-up, here we go:

1. Make sure that “Excel Services” (Actually “Excel Calculation Services”) is running. To check this out please do the following steps:

Central Administration –> Operations under “Topology and Services” click “Services on server” 

On the table below we can see the “Excel Calculation Services” is started. So it’s running 🙂

2. Make sure that, file access method of “Excel Services Settings” is using “Process Account”, instead of the Impersonation. To do this, follow these steps:

Go to Central Administration –> Home

On the left menu, under “Shared Services Administration” Select your “Shared Services” (for me SharedServices2 but default SharedServices1)

Under “Excel Services Settings” click the “Edit Excel Services Settings” 

Change the file access method to “Process Account”.

3. Finally make the following changes on the Trusted file locations under “Excel Services Settings”. Here are the steps:

Go to the “Shared Services” underExcel Services Settings” click the ”Trusted file locations”.

You will be navigating to the Excel Services Trusted File Locations page. Then click “Add Trusted File Location”.

In the Location pane, do the following:

– Address: In this field we can enter a Document library or full portal Url (I have given Document library path). Please note: Don’t use like http://server:1010/documentlibrary1/forms/default.aspx instead of http://server:1010/documentlibrary1

– Location Type: For this field we have to select the “Windows SharePoint Services” option

– Trust Children: Ensure whether we need to be trusted the child libraries or directories, here I selected “Children Trusted”

Then click OK, that’s all! It is working huh! 🙂

References:

1. http://www.eggheadcafe.com/community/sharepoint/69/10068914/you-do-not-have-permissions-to-open-this-file-on-excel-services.aspx

2. http://blogs.msdn.com/b/andreww/archive/2009/04/21/excel-services-setup-and-getting-started.aspx

, , , , , , , , ,

3 Comments

How to get the current user’s OU (Organizational Unit) from AD (Active Directory) – C#

There are so many ways to get the user details form AD (Active directory), but I wanted to get the current user’s OU (Organizational Unit) from Active directory. There is no any direct method to get the OU (Actually I could not find anything on the web, if anyone get an easy way to find-out please let me know). I am currently developing a Custom Search for SharePoint 2007 and according to the OU, I want to display the search results.

Here is the method I have created and most of the comments I have put in the code itself. I used Asp.net and C#.

public string GetOU(string username)
 {
 string result = string.Empty;
 using (HostingEnvironment.Impersonate())
 {
 //Getting the domain
 PrincipalContext yourDomain = new PrincipalContext(ContextType.Domain);

//Finding the user
 UserPrincipal user = UserPrincipal.FindByIdentity(yourDomain, username);

//If the user found
 if (user != null)
 {
 // Getting the DirectoryEntry
 DirectoryEntry directoryEntry = (user.GetUnderlyingObject() as DirectoryEntry);
 //if the directoryEntry is not null
 if (directoryEntry != null)
 {
 //Getting the directoryEntry's path and spliting with the "," character
 string[] directoryEntryPath = directoryEntry.Path.Split(',');
 //Getting the each items of the array and spliting again with the "=" character
 foreach (var splitedPath in directoryEntryPath)
 {
 string[] eleiments = splitedPath.Split('=');
 //If the 1st element of the array is "OU" string then get the 2dn element
 if (eleiments[0].Trim() == "OU")
 {
 result = username + "-" + eleiments[1].Trim();
 break;
 }
 }
 }
 }
 }
 return result;
 }

Please don’t forget to add the following references:

using System.Collections;
using System.DirectoryServices.AccountManagement;
using System.DirectoryServices;
using System.Security.Principal;

If you want to get the current user’s OU then you can call this method in the Page_Load event.

protected void Page_Load(object sender, EventArgs e)
{
string userName = Context.User.Identity.Name;
LabelOU.Text = GetOU(userName);
}

You will get the output like this:

Domain-Name\RajanihanthV
OU-Name
I hope this small C# code will be helping someone! Thanks R./

References:

1. http://stackoverflow.com/questions/637486/how-to-get-the-current-users-active-directory-details-in-c-sharp

2. http://stackoverflow.com/questions/5309988/how-to-get-the-groups-of-a-user-in-active-directory-c-asp-net

, , , , , , , , , , , ,

7 Comments