Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 Code Access Problems also kinda Report Manager

Author  Topic 

XericCoder
Starting Member

12 Posts

Posted - 2005-03-09 : 12:31:18
System Variables:
Server OS = 2003 Server
Reporting Services = 2000 Enterprise
Architecture = Client Server

Problem:
I have successfully deployed reports to my SQL/Reporting Services server. I can call these reports with a URL with no problem. However when I try instantiating these reports in code I receive the 401 unauthorized.
I've tried every possible permutation of enabling Anonymous Access and Integrated Windows Authentication.
I have fliped between assigned network credentials and default network credentials.
I have tried assign group/role policy privileges and assigning the network credentialed user to that group.
I have gone as far as embedding the Admin password to that machine in the credential creation code.
The results have always been 401/unauthorized.
Oh ya, I also set rs.PreAuthenticate = true;.

I'm not sure if this is releated, but...
On the server box after installation I navigate programs - Microsoft SQL Server - Reporting Services - Report Manager and receive "The page cannot be displayed" error. When I navigate to the Report server via my computer I receive a 401/Unauthorized.

Also, another Side-effect/oddditiy is that when I navigate to my remote server's report directory via http://<servername>/<ReportServerName> I receive the list of the services and can navigate to the reports I have created with no problem at all. When I type the exact same URL while logged on (either remote desktop/on the box) I receive "The page cannot be displayed" error. I've also tried changing the URL string to localhost.

My Fear:
I re-installed reporting services and noticed that it wanted Visual Studio 2003 as a prerequisite. Now I sold this reporting architecture on the premise that no additional licensing will be needed because it is a feature of SQL Server. Was I toatally wrong in my assesment? Is a VS license also going to be required in order to deploy these reporting solutions?

My main issue is accessing these reports through code. Currently we have a report page that were using to display Crystal Reports(YUK) through the ExportToStream method. I would like to reuse the same page to display the RS reports using the render method. At this time the report manager feature isn't really needed, but I thought I would list it as it might provide some insight to a larger problem.

Thank you inadvance for addressing my problem and for reading my novel of a problem.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-03-09 : 12:34:33
Visual Studio is used to design the reports. You don't need it for the deployment, just for the developor.

We use the MS provided Report Viewer to display the reports.

If Report Manager isn't working, then you've got a problem.

Is Report Server installed on the same server as the SQL Server? If not, then you need another SQL Server license. You only get Reporting Services for free when you install the server portion on the database server which is not an ideal solution for larger shops as you don't want IIS running on the database server.

If you can call the reports via URLs, then why not use the URL method as described in the documentation?

Tara
Go to Top of Page

XericCoder
Starting Member

12 Posts

Posted - 2005-03-09 : 13:17:54
"If Report Manager isn't working, then you've got a problem."
Well report manager isn't working, but the reports are.

"Is Report Server installed on the same server as the SQL Server"
Yes

"If you can call the reports via URLs, then why not use the URL method as described in the documentation?"
There is also the ReportingService.Render method that returns a bit array that you can write to the response object via the BinaryWrite method. This is preferable to me because it allows me to instantiate the report and maybe change change properties prior to display. This method of rendering reports is also described in the documentation.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-03-09 : 13:23:01
quote:
Originally posted by XericCoder

Well report manager isn't working, but the reports are.




Report Manager isn't the same thing as Report Viewer.

I am perplexed by your problem as if you can call these reports via URLs, then everything should work. It's possible you have some IIS misconfiguration with the Reports web site. I don't have enough knowledge about IIS to say what this could be though. Have you tried installing Report Server on another machine to see if it works fine elsewhere?

Tara
Go to Top of Page

XericCoder
Starting Member

12 Posts

Posted - 2005-03-09 : 15:10:59
quote:
Originally posted by tduggan

quote:
Originally posted by XericCoder

Well report manager isn't working, but the reports are.




Report Manager isn't the same thing as Report Viewer.



I'm sorry but how does "Well report manager isn't working, but the reports are." equate to my saying that Report Manager is the same thing as Report Viewer?

Yes, I can connect to the report MANAGER on my local development box. I would rather not take the time of changing my connection and architecture to have things running off of my development box. I like the adage "Train as you fight".
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-03-09 : 15:16:02
I'm sorry, I misread your statement.

Tara
Go to Top of Page

XericCoder
Starting Member

12 Posts

Posted - 2005-03-09 : 15:26:28
No worries, I really appreciate your trying to help me. I'm terribly frustrated and perplexed.
I can find similar posts on other forums, but I've listed all of my attempted solutions that have not returned the desired result.
I forgot to mention that I made sure the server was listed as a trusted site thourgh IE.
All of the documentation and literature I can find says exactly what your are saying If the reports work all should work.
Go to Top of Page

XericCoder
Starting Member

12 Posts

Posted - 2005-03-09 : 18:25:44
Ok, so I went ahead and deployed the report to my local box. I can call the report from code in the manner described above with no problem. Here is an example of the code that I use to display the report as a PDF in the browser.

Response.Clear();
Response.Buffer= true;
Response.ContentType = "application/pdf";
User user = (User) Session["User"];
ReportingService rs = new ReportingService();
rs.PreAuthenticate = true;
rs.Credentials = new NetworkCredential(myUserName,myPassword,myDomain);

LocalReportServer.ParameterValue[] parameters = new EPMBrowserUI.LocalReportServer.ParameterValue[3];
string encoding;
string mimeType = ".pdf";
string path = "/Reports/myReport";

LocalReportServer.ParameterValue pvInstitution = new EPMBrowserUI.LocalReportServer.ParameterValue();
LocalReportServer.ParameterValue pvStartDate = new EPMBrowserUI.LocalReportServer.ParameterValue();
LocalReportServer.ParameterValue pvEndDate = new EPMBrowserUI.LocalReportServer.ParameterValue();
pvInstitution.Name = "InstitutionID";
pvStartDate.Name = "StartDate";
pvEndDate.Name = "EndDate";
pvInstitution.Value = user.SelectedInstitution.ToString();
pvStartDate.Value = StartDate.ToString();
pvEndDate.Value = EndDate.ToString();
parameters[0] = pvInstitution;
parameters[1] = pvStartDate;
parameters[2] = pvEndDate;

string format = "PDF";
LocalReportServer.ParameterValue[] parametersUsed;
Warning[] warnings;
string[] streamIDs;

ReportsBite = rs.Render(path,format,null,null,parameters,null,null, out encoding
,out mimeType,out parametersUsed,out warnings, out streamIDs);

Response.BinaryWrite(ReportsBite);

The nice thing about this is that I have a single report page and for the reports that I haven't converted from crystal yet I can use that same page. Some of this code has been pulled out from a switch Case clause.

But now the problem remains that when I try and run this code on a remote server it does not work. I am a local administrator on that server, so the permission issue is not with credentials.(I have tried a number of other things to ensure that this is not the case.) Are there any known Reporting Services on Server 2003 issues. I rememmber comming accross a post on a different forum that descibed fixing the problem that I am having, but they also moved thier reports to a win2kPro/XP box.
Go to Top of Page

XericCoder
Starting Member

12 Posts

Posted - 2005-03-30 : 12:20:24
After about 6.5 hours on the phone with Microsoft it turned out the problem was that a default setting in IIS had been changed. The "Enable HTTP Keep Alives" property must be checked in order for Windows Authentication to work correctly.
Symptoms of this were that the report manager would return “Page Cannot be displayed” when trying to connect from the local machine, but would return the correct page, but an unauthorized error when the site was configured to allow anonymous access.
Of course everything above were also symptoms, but this might be the easiest way to distinguish this problem.
Go to Top of Page
   

- Advertisement -