Showing posts with label localhost. Show all posts
Showing posts with label localhost. Show all posts

Wednesday, March 21, 2012

Help! Invalid URI: The hostname could not be parsed.

I have installed SQL server 2005 and reporting services. When i try this: http://localhost/reports/ I get ->

Invalid URI: The hostname could not be parsed.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.UriFormatException: Invalid URI: The hostname could not be parsed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[UriFormatException: Invalid URI: The hostname could not be parsed.]

System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind) +1647482

System.Uri..ctor(String uriString) +17

Microsoft.ReportingServices.Diagnostics.UIConfiguration.ParseXML(XmlNode node, RSConfiguration configObject) +1051

Microsoft.ReportingServices.Diagnostics.RSConfiguration.ParseDocument() +972

Microsoft.ReportingServices.Diagnostics.RSConfiguration.Load() +32

[ServerConfigurationErrorException: The report server has encountered a configuration error. See the report server log files for more information.]

Microsoft.ReportingServices.Diagnostics.RSConfiguration.Load() +166

Microsoft.ReportingServices.Diagnostics.RSConfiguration.Construct(String configFileName) +62

Microsoft.ReportingServices.Diagnostics.RSConfiguration..ctor(String configFileName, String location) +296

Microsoft.ReportingServices.Diagnostics.RSConfigurationManager..ctor(String configFileName, String configLocation) +134

Microsoft.ReportingServices.UI.Global.get_ConfigurationManager() +84

Microsoft.ReportingServices.UI.Global.get_Configuration() +4

Microsoft.ReportingServices.UI.GlobalApp.Application_AuthenticateRequest(Object sender, EventArgs e) +84

System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92

System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64

Reporting services config manager shows all green checks. Any ideas?

thanks, Jason

What happens when you go to http://servername/reportserver? Do you see an entry in the RSReportServerXXX.log file that describes the property that it is trying to read? Does the RSReportServer.config configuration file look OK?

Wednesday, March 7, 2012

HELP! - URL Access - Localhost vs. ServerName

We have a confusing problem and need some guidance.

We are trying to use URL access to generate and display a report. We have tried two ways--building the URL string and popping up a new browser with the Reporting Services URL access string and simply using an anchor tag and setting its URL parameter to the Reporting Services URL access string. Both options don't work--well, one works for the local server and the other works for client computers (not the server), but neither work for both.

Basically, we're having trouble using localhost vs. servername in our URL access string.

The examples below use localhost.
These work fine from the server which Reporting Services and IIS are running, but not from other computers (because of the "localhost").
// Build the URL for the report
url = "http://localhost/ReportServer?/Reports/MyReport&rs:Command=Render&rs:format=HTML4.0&rc:Parameters=false&rc:Zoom=Page Width";
// Build the javascript to display the message
string sScript = "<script language=\"javascript\" type=\"text/javascript\">window.open(\"" + url + "\", \"ReportsDateSelectionGenerateReport\", \"height=675,width=975,left=0,top=0,copyHistory=no,directories=no,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no\");</script>";
// Execute the script
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "LinkButtonGenerateReport_Click", sScript);


<a id="runreport" runat="server" target="_blank" style="font-size: large; font-weight: bold;">View Report</a>
this.runreport.HRef = "http://localhost/ReportServer?/Reports/MyReport&rs:Command=Render&rs:format=HTML4.0&rc:Parameters=false&rc:Zoom=Page Width";


The examples below use the servername for URL access.
These work fine from other computers (because of the server name), but I get the Connect to <servername> popup asking for User name and Password when I run from the server which Reporting Services and IIS are running.
// Build the URL for the report
url = "http://" + <servername> + "/ReportServer?/Reports/MyReport&rs:Command=Render&rs:format=HTML4.0&rc:Parameters=false&rc:Zoom=Page Width";
// Build the javascript to display the message
string sScript = "<script language=\"javascript\" type=\"text/javascript\">window.open(\"" + url + "\", \"ReportsDateSelectionGenerateReport\", \"height=675,width=975,left=0,top=0,copyHistory=no,directories=no,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no\");</script>";
// Execute the script
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "LinkButtonGenerateReport_Click", sScript);


<a id="runreport" runat="server" target="_blank" style="font-size: large; font-weight: bold;">View Report</a>
this.runreport.HRef = "http://" + <servername> + "/ReportServer?/Reports/MyReport&rs:Command=Render&rs:format=HTML4.0&rc:Parameters=false&rc:Zoom=Page Width";

I guess the main issue is using the servername in the URL access string pops up the connect to server dialog wanting a user name and password, even though we're trying to access the report on the server running Reporting Services and IIS. We're using Windows Authentication and impersonation (in our Web.config file), and we're logged into the server as local Administrator. Therefore, we should have no permissions issues.

How can we use the servername in URL access for both the server and client workstation to generate and display reports?

Thanks in advance.

That is very strange. You should be able to subsitute the server name for localhost on the server. Do you get this same behavior when you try this form IE?

How do you get <servername>? Is it possibly getting the wrong value when on the local machine?

|||

Well, I'm always using IE. We don't support other browsers (our ASP.NET 2.0 (C#) application is an intranet application and end-users are required to use IE).

And, yes, we get the same behavior if we copy and paste the entire URL string into the browser's Address bar. It's the same thing as if we were running it through our app's code.

It seems kind of wierd to us too. It seems that if you're working on the server, using the server name should work fine (just like using "localhost").

By the way, we're working on a Win 2003 server with SP1 and using SQL Server 2005 Reporting Services. I read somewhere that the security settings in Win 2003 might be causing such an issue.

As for the servername, we're getting it using a .NET method (I can't remember right now). But, we've definitely tested this and are getting the correct server name from both the server and workstation.

So, we're stumped. Any ideas?

Thanks!

|||

Is there any other .NET Framework class with a property or method that would tell whether the request is coming from a different computer or if the request is coming from the server itself?

Then I could say:

if (coming from workstation computer--not the server == true)
{
// use http://servername/ReportServer...
}
else if (coming from a browser on the server == true)
{
// use http://localhost/ReportServer...
}

Any thoughts?

|||

You could always check the request IP address, but that would be masking the issue rather then fixing the cause.

Have you tried to repro this via your own web app? My guess this is more of an IIS configuration issue then an RS issue. I will have one of our other devs look over this thread and see if he has any other suggestions.

HELP! - URL Access - Localhost vs. ServerName

We have a confusing problem and need some guidance.

We are trying to use URL access to generate and display a report. We have tried two ways--building the URL string and popping up a new browser with the Reporting Services URL access string and simply using an anchor tag and setting its URL parameter to the Reporting Services URL access string. Both options don't work--well, one works for the local server and the other works for client computers (not the server), but neither work for both.

Basically, we're having trouble using localhost vs. servername in our URL access string.

The examples below use localhost.
These work fine from the server which Reporting Services and IIS are running, but not from other computers (because of the "localhost").
// Build the URL for the report
url = "http://localhost/ReportServer?/Reports/MyReport&rs:Command=Render&rs:format=HTML4.0&rc:Parameters=false&rc:Zoom=Page Width";
// Build the javascript to display the message
string sScript = "<script language=\"javascript\" type=\"text/javascript\">window.open(\"" + url + "\", \"ReportsDateSelectionGenerateReport\", \"height=675,width=975,left=0,top=0,copyHistory=no,directories=no,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no\");</script>";
// Execute the script
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "LinkButtonGenerateReport_Click", sScript);


<a id="runreport" runat="server" target="_blank" style="font-size: large; font-weight: bold;">View Report</a>
this.runreport.HRef = "http://localhost/ReportServer?/Reports/MyReport&rs:Command=Render&rs:format=HTML4.0&rc:Parameters=false&rc:Zoom=Page Width";


The examples below use the servername for URL access.
These work fine from other computers (because of the server name), but I get the Connect to <servername> popup asking for User name and Password when I run from the server which Reporting Services and IIS are running.
// Build the URL for the report
url = "http://" + <servername> + "/ReportServer?/Reports/MyReport&rs:Command=Render&rs:format=HTML4.0&rc:Parameters=false&rc:Zoom=Page Width";
// Build the javascript to display the message
string sScript = "<script language=\"javascript\" type=\"text/javascript\">window.open(\"" + url + "\", \"ReportsDateSelectionGenerateReport\", \"height=675,width=975,left=0,top=0,copyHistory=no,directories=no,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no\");</script>";
// Execute the script
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "LinkButtonGenerateReport_Click", sScript);


<a id="runreport" runat="server" target="_blank" style="font-size: large; font-weight: bold;">View Report</a>
this.runreport.HRef = "http://" + <servername> + "/ReportServer?/Reports/MyReport&rs:Command=Render&rs:format=HTML4.0&rc:Parameters=false&rc:Zoom=Page Width";

I guess the main issue is using the servername in the URL access string pops up the connect to server dialog wanting a user name and password, even though we're trying to access the report on the server running Reporting Services and IIS. We're using Windows Authentication and impersonation (in our Web.config file), and we're logged into the server as local Administrator. Therefore, we should have no permissions issues.

How can we use the servername in URL access for both the server and client workstation to generate and display reports?

Thanks in advance.

That is very strange. You should be able to subsitute the server name for localhost on the server. Do you get this same behavior when you try this form IE?

How do you get <servername>? Is it possibly getting the wrong value when on the local machine?

|||

Well, I'm always using IE. We don't support other browsers (our ASP.NET 2.0 (C#) application is an intranet application and end-users are required to use IE).

And, yes, we get the same behavior if we copy and paste the entire URL string into the browser's Address bar. It's the same thing as if we were running it through our app's code.

It seems kind of wierd to us too. It seems that if you're working on the server, using the server name should work fine (just like using "localhost").

By the way, we're working on a Win 2003 server with SP1 and using SQL Server 2005 Reporting Services. I read somewhere that the security settings in Win 2003 might be causing such an issue.

As for the servername, we're getting it using a .NET method (I can't remember right now). But, we've definitely tested this and are getting the correct server name from both the server and workstation.

So, we're stumped. Any ideas?

Thanks!

|||

Is there any other .NET Framework class with a property or method that would tell whether the request is coming from a different computer or if the request is coming from the server itself?

Then I could say:

if (coming from workstation computer--not the server == true)
{
// use http://servername/ReportServer...
}
else if (coming from a browser on the server == true)
{
// use http://localhost/ReportServer...
}

Any thoughts?

|||

You could always check the request IP address, but that would be masking the issue rather then fixing the cause.

Have you tried to repro this via your own web app? My guess this is more of an IIS configuration issue then an RS issue. I will have one of our other devs look over this thread and see if he has any other suggestions.