Showing posts with label path. Show all posts
Showing posts with label path. Show all posts

Wednesday, March 28, 2012

ReportViewer axd path

Hello,

I'm having problems using the ReportViewer control (which you can use in VS2005). When I go to the page that contains the control, the images (back, next, print, etc) don't show up and I get different javascript errors (one of them is the "RSClientController is undefined" error). After some investigation, I found out that the path to the Reserved.ReportViewerWebControl.axd file is incorrect (as I see it in the page source). On every place this axd file is used (for the images and the necessary javascript file), the path is "/Reserved.ReportViewerWebControl.axd?...", while it should be "/reportserver/Reserved.ReportViewerWebControl.axd?...". If I go directly to the "/reportserver/..." url, I can retrieve the images and javascript file. So, somewhere the path to the axd file is set in a wrong way.

For example:
<script src="/Reserved.ReportViewerWebControl.axd?OpType=Resource&amp;Version=8.0.50727.42&amp;Name=Scripts.ReportViewer.js" type="text/javascript"></script>
while this should be:
<script src="/ReportServer/Reserved.ReportViewerWebControl.axd?OpType=Resource&amp;Version=8.0.50727.42&amp;Name=Scripts.ReportViewer.js" type="text/javascript"></script>

I have included the ReportViewer control in a usercontrol (ascx). This usercontrol is implemented in Sharepoint using the "Son of Smartpart" webpart. I'm using SQL Reporting Services 2005 (with the database, SQL Server 2005, hosted on another server). Using the ReportManager, everything is fine.

I really need to get this working, but I'm out of ideas (I've been searching for days to solve this, but can't seem to find the correct solution).

Any ideas?

Sven

One ugly hack would be to copy the javascript and images to where it is looking for it... (root)

Did you set the reportserver url in your control?

http://www.devx.com/dotnet/Article/30610/0/page/2

Have you tried using www.sysinternal.com filemon on the web server to determine where it's looking for files and whether there are permission issues?

Here is another thread that mentions a similar issue.

cheers,

Andrew

|||

Hey Andrew,

Thanks for your quick reply.
I'm not sure whether that "ugly hack" would be possible. To be honest, I don't know the exact working of the axd HttpHandler, but I don't think I can modify the ReportViewer control and tell it to get the images from somewhere else. As far as I have understood, the images and javascript file are retrieved from the database, only the axd file (which is generated on the fly again: that is what I've read) is in the wrong location.

The ReportServer url is correctly set in my control.

Sven

|||

You may be able to get at these files from your internet cache directory and then place them in the root of the web server, but it doesn't fix the underlying issue.

Also, if you haven't already, try posting in Report Controls forum.

http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=75&SiteID=1

Are you using any kind of authentication mechanism, and has the directory been configured as an application? Do you have fixed headers in your report?

cheers,

Andrew

|||

Hello Andrew,

I'm not using some special kind of authentication mechanism. Although, I am implementing the Report Viewer (or at least trying to do this) in a Sharepoint application, which has its own security mechanism. The directory is configured as an application (Sharepoint does this for you btw). I don't have any fixed headers in my report, the control fails even when I try to view a very basic (Northwind) report.

It's strange that the path to my axd is wrong, possibly Sharepoint is causing this but at this moment I still don't have any clue.

Sven

|||

Hey Sven,

Did you get how to solve your issue, I think I got the same problem.

|||

Hey Renan,

Sorry for the late reply. I didn't really solve the problem. Actually, I don't think it can be solved :).

I'm quite sure the problem has something to do with the HttpHandlers. I think that SharePoint overrides the HttpHandler that you set (the famous .axd file), which is why the control doesn't render correctly.

What I did: I created a new web application in a new Virtual Directory (under the root of the SharePoint web app) and created an aspx page that contains the Report Viewer control. I copied the SharePoint toolbar from the HTML source into the aspx page so the user doesn't notice that he's actually in another web app.

Hope this helps.

Sven

ReportViewer axd path

Hello,

I'm having problems using the ReportViewer control (which you can use in VS2005). When I go to the page that contains the control, the images (back, next, print, etc) don't show up and I get different javascript errors (one of them is the "RSClientController is undefined" error). After some investigation, I found out that the path to the Reserved.ReportViewerWebControl.axd file is incorrect (as I see it in the page source). On every place this axd file is used (for the images and the necessary javascript file), the path is "/Reserved.ReportViewerWebControl.axd?...", while it should be "/reportserver/Reserved.ReportViewerWebControl.axd?...". If I go directly to the "/reportserver/..." url, I can retrieve the images and javascript file. So, somewhere the path to the axd file is set in a wrong way.

For example:
<script src="/Reserved.ReportViewerWebControl.axd?OpType=Resource&amp;Version=8.0.50727.42&amp;Name=Scripts.ReportViewer.js" type="text/javascript"></script>
while this should be:
<script src="/ReportServer/Reserved.ReportViewerWebControl.axd?OpType=Resource&amp;Version=8.0.50727.42&amp;Name=Scripts.ReportViewer.js" type="text/javascript"></script>

I have included the ReportViewer control in a usercontrol (ascx). This usercontrol is implemented in Sharepoint using the "Son of Smartpart" webpart. I'm using SQL Reporting Services 2005 (with the database, SQL Server 2005, hosted on another server). Using the ReportManager, everything is fine.

I really need to get this working, but I'm out of ideas (I've been searching for days to solve this, but can't seem to find the correct solution).

Any ideas?

Sven

One ugly hack would be to copy the javascript and images to where it is looking for it... (root)

Did you set the reportserver url in your control?

http://www.devx.com/dotnet/Article/30610/0/page/2

Have you tried using www.sysinternal.com filemon on the web server to determine where it's looking for files and whether there are permission issues?

Here is another thread that mentions a similar issue.

cheers,

Andrew

|||

Hey Andrew,

Thanks for your quick reply.
I'm not sure whether that "ugly hack" would be possible. To be honest, I don't know the exact working of the axd HttpHandler, but I don't think I can modify the ReportViewer control and tell it to get the images from somewhere else. As far as I have understood, the images and javascript file are retrieved from the database, only the axd file (which is generated on the fly again: that is what I've read) is in the wrong location.

The ReportServer url is correctly set in my control.

Sven

|||

You may be able to get at these files from your internet cache directory and then place them in the root of the web server, but it doesn't fix the underlying issue.

Also, if you haven't already, try posting in Report Controls forum.

http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=75&SiteID=1

Are you using any kind of authentication mechanism, and has the directory been configured as an application? Do you have fixed headers in your report?

cheers,

Andrew

|||

Hello Andrew,

I'm not using some special kind of authentication mechanism. Although, I am implementing the Report Viewer (or at least trying to do this) in a Sharepoint application, which has its own security mechanism. The directory is configured as an application (Sharepoint does this for you btw). I don't have any fixed headers in my report, the control fails even when I try to view a very basic (Northwind) report.

It's strange that the path to my axd is wrong, possibly Sharepoint is causing this but at this moment I still don't have any clue.

Sven

|||

Hey Sven,

Did you get how to solve your issue, I think I got the same problem.

|||

Hey Renan,

Sorry for the late reply. I didn't really solve the problem. Actually, I don't think it can be solved :).

I'm quite sure the problem has something to do with the HttpHandlers. I think that SharePoint overrides the HttpHandler that you set (the famous .axd file), which is why the control doesn't render correctly.

What I did: I created a new web application in a new Virtual Directory (under the root of the SharePoint web app) and created an aspx page that contains the Report Viewer control. I copied the SharePoint toolbar from the HTML source into the aspx page so the user doesn't notice that he's actually in another web app.

Hope this helps.

Sven

sql

Wednesday, March 7, 2012

reportingservice.render does not work - path not found?

I am having problems getting a call to ReportingService.render to work. I
keep getting this error:
System.Web.Services.Protocols.SoapException: The path of the item
'/ReportServer/report%20project1?%2fReport+Project1%2fReport1' is not
valid. The full path must be less than 260 characters long, must start
with slash; other restrictions apply. Check the documentation for
complete set of restrictions. -->
This comes from a url that worked in the browswer, which I then cut and
pasted into the code. Here is the rest of the code:
Dim rs As gscan.localhost.ReportingService _
= New localhost.ReportingService
Dim report As Byte() = Nothing
' Create an instance of the Reporting Services
' Web Reference.
' Create the credentials that will be used when accessing
' Reporting Services. This must be a logon that has rights
' to the Axelburg Invoice-Batch Number report.
' *** Replace "LoginName", "Password", and "Domain" with
' the appropriate values. ***
'rs.Credentials = New _
' System.Net.NetworkCredential("LoginName", _
' "Password", "Domain")
rs.Credentials = New _
System.Net.NetworkCredential("user.name", _
"password", "workgroup")
rs.PreAuthenticate = True
' The Reporting Services virtual path to the report.
Dim reportPath As String = _
"/ReportServer/report%20project1?%2fReport+Project1%2fReport1" 'path not valid
'http://localhost/Reportserver/report%20project1?%2fReport+Project1%2fReport1&rs:Command=Render 'works in the browser
' The rendering format for the report.
Dim format As String = "HTML4.0"
' The devInfo string tells the report viewer
' how to display with the report.
Dim devInfo As String = _
"<DeviceInfo>" + _
"<Toolbar>False</Toolbar>" + _
"<Parameters>False</Parameters>" + _
"<DocMap>True</DocMap>" + _
"<Zoom>100</Zoom>" + _
"</DeviceInfo>"
' Create an array of the values for the report parameters
' Dim parameters(1) As localhost.ParameterValue
Dim parameters() As localhost.ParameterValue = Nothing
Dim historyID As String = Nothing
Dim credentials() As localhost.DataSourceCredentials = Nothing
Dim showHideToggle As String = Nothing
Dim encoding As String
Dim mimeType As String
Dim warnings() As localhost.Warning = Nothing
Dim reportHistoryParameters() As _
localhost.ParameterValue = Nothing
Dim streamIDs() As String = Nothing
Dim sh As localhost.SessionHeader = _
New localhost.SessionHeader
rs.SessionHeaderValue = sh
Try
' Execute the report.
report = rs.Render(reportPath, format, historyID, _
devInfo, parameters, credentials, _
showHideToggle, encoding, mimeType, _
reportHistoryParameters, warnings, _
streamIDs)
sh.SessionId = rs.SessionHeaderValue.SessionId
' Flush any pending response.
Response.Clear()
' Set the HTTP headers for a PDF response.
HttpContext.Current.Response.ClearHeaders()
HttpContext.Current.Response.ClearContent()
HttpContext.Current.Response.ContentType = "text/html"
' filename is the default filename displayed
' if the user does a save as.
HttpContext.Current.Response.AppendHeader( _
"Content-Disposition", _
"filename=""Invoice-BatchNumber.HTM""")
' Send the byte array containing the report
' as a binary response.
HttpContext.Current.Response.BinaryWrite(report)
HttpContext.Current.Response.End()
Catch ex As Exception
If ex.Message <> "Thread was being aborted." Then
HttpContext.Current.Response.ClearHeaders()
HttpContext.Current.Response.ClearContent()
HttpContext.Current.Response.ContentType = "text/html"
HttpContext.Current.Response.Write( _
"&
Error" & _
ex.Message & "
")
HttpContext.Current.Response.End()
End If
End Try
End SubRemove the virtual directory name from the path.
string path = "/Report Project1/Reports/ReportName"
--
| Thread-Topic: reportingservice.render does not work - path not found?
| thread-index: AcWDATJ6XDR3wjtuT+iwdTWjP/QvDw==| X-WBNR-Posting-Host: 65.173.228.40
| From: "=?Utf-8?B?bmlja3B1cA==?=" <nickpup@.discussions.microsoft.com>
| Subject: reportingservice.render does not work - path not found?
| Date: Thu, 7 Jul 2005 07:36:01 -0700
| Lines: 99
| Message-ID: <345CE1C7-7BD5-4834-83BA-9148DE9338C0@.microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.sqlserver.reportingsvcs
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.reportingsvcs:47592
| X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
|
| I am having problems getting a call to ReportingService.render to work.
I
| keep getting this error:
|
| System.Web.Services.Protocols.SoapException: The path of the item
| '/ReportServer/report%20project1?%2fReport+Project1%2fReport1' is not
| valid. The full path must be less than 260 characters long, must start
| with slash; other restrictions apply. Check the documentation for
| complete set of restrictions. -->
|
| This comes from a url that worked in the browswer, which I then cut and
| pasted into the code. Here is the rest of the code:
|
| Dim rs As gscan.localhost.ReportingService _
| = New localhost.ReportingService
|
| Dim report As Byte() = Nothing
| ' Create an instance of the Reporting Services
| ' Web Reference.
| ' Create the credentials that will be used when accessing
| ' Reporting Services. This must be a logon that has rights
| ' to the Axelburg Invoice-Batch Number report.
| ' *** Replace "LoginName", "Password", and "Domain" with
| ' the appropriate values. ***
| 'rs.Credentials = New _
| ' System.Net.NetworkCredential("LoginName", _
| ' "Password", "Domain")
| rs.Credentials = New _
| System.Net.NetworkCredential("user.name", _
| "password", "workgroup")
| rs.PreAuthenticate = True
| ' The Reporting Services virtual path to the report.
| Dim reportPath As String = _
|
| "/ReportServer/report%20project1?%2fReport+Project1%2fReport1" 'path not
valid
|
|
'http://localhost/Reportserver/report%20project1?%2fReport+Project1%2fReport
1&rs:Command=Render 'works in the browser
| ' The rendering format for the report.
| Dim format As String = "HTML4.0"
| ' The devInfo string tells the report viewer
| ' how to display with the report.
| Dim devInfo As String = _
| "<DeviceInfo>" + _
| "<Toolbar>False</Toolbar>" + _
| "<Parameters>False</Parameters>" + _
| "<DocMap>True</DocMap>" + _
| "<Zoom>100</Zoom>" + _
| "</DeviceInfo>"
| ' Create an array of the values for the report parameters
| ' Dim parameters(1) As localhost.ParameterValue
| Dim parameters() As localhost.ParameterValue = Nothing
| Dim historyID As String = Nothing
| Dim credentials() As localhost.DataSourceCredentials = Nothing
| Dim showHideToggle As String = Nothing
| Dim encoding As String
| Dim mimeType As String
| Dim warnings() As localhost.Warning = Nothing
| Dim reportHistoryParameters() As _
| localhost.ParameterValue = Nothing
| Dim streamIDs() As String = Nothing
| Dim sh As localhost.SessionHeader = _
| New localhost.SessionHeader
| rs.SessionHeaderValue = sh
| Try
| ' Execute the report.
| report = rs.Render(reportPath, format, historyID, _
| devInfo, parameters, credentials, _
| showHideToggle, encoding, mimeType, _
| reportHistoryParameters, warnings, _
| streamIDs)
| sh.SessionId = rs.SessionHeaderValue.SessionId
| ' Flush any pending response.
| Response.Clear()
| ' Set the HTTP headers for a PDF response.
| HttpContext.Current.Response.ClearHeaders()
| HttpContext.Current.Response.ClearContent()
| HttpContext.Current.Response.ContentType = "text/html"
| ' filename is the default filename displayed
| ' if the user does a save as.
| HttpContext.Current.Response.AppendHeader( _
| "Content-Disposition", _
| "filename=""Invoice-BatchNumber.HTM""")
| ' Send the byte array containing the report
| ' as a binary response.
| HttpContext.Current.Response.BinaryWrite(report)
| HttpContext.Current.Response.End()
| Catch ex As Exception
| If ex.Message <> "Thread was being aborted." Then
| HttpContext.Current.Response.ClearHeaders()
| HttpContext.Current.Response.ClearContent()
| HttpContext.Current.Response.ContentType = "text/html"
| HttpContext.Current.Response.Write( _
| "&
Error" & _
| ex.Message & "
")
| HttpContext.Current.Response.End()
| End If
| End Try
| End Sub
|
|
|

ReportingServer Path (Url)

Hello
I develop my reports local on my pc (VS2003, IIS5, SQL Server 2000 and
ReportingServer are on the same Pc) and when i be finish then i want
transfer the reports to official ReportingServer.
Now my question witch files must transfer to the ReportingServer? And when i
transfer the files to another server then i think i must change the
ReportingServer-Path, how can do that? I see that i can change the path in
the VS-Project-Code, but can i do that purhaps with a Config-File or at real
time?
Thank you very much
Regards
RogerIf you are talking about reports ONLY , then the .RDL file is the only file
which must be transferred...
A common method is to use the Web interface on the production server to
UPLOAD the RDL files. That way you do not have to change anything on your
test side...Just tell the production guy where the RDL is.
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"R.Odermatt" <roger.odermatt@.nospam.swica.ch> wrote in message
news:uME3TRi%23EHA.1544@.TK2MSFTNGP11.phx.gbl...
> Hello
> I develop my reports local on my pc (VS2003, IIS5, SQL Server 2000 and
> ReportingServer are on the same Pc) and when i be finish then i want
> transfer the reports to official ReportingServer.
> Now my question witch files must transfer to the ReportingServer? And when
i
> transfer the files to another server then i think i must change the
> ReportingServer-Path, how can do that? I see that i can change the path in
> the VS-Project-Code, but can i do that purhaps with a Config-File or at
real
> time?
> Thank you very much
> Regards
> Roger
>|||The only issue deployment might give you is if you have used jump to url
action. Otherwise everything is handled for you. Install your production
server, then from the the development environment you set the
TargetServerURL (you can have multiple configuration, for instance I have a
debug server and a production server). To set the TargetServerURL you do a
right mouse click on the project in your solution explorer, properties.
Then you deploy from the IDE (you can also script this but using the Visual
Studio is easiest). It deploys the data sources as well and after deployment
you might need to configure them at the server. After deploying once VS does
not overwrite the data sources, it just warns, so once you setup the data
sources on your production server they will not get overwritten.
Be sure to read up on how to setup security as well on the production
server.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"R.Odermatt" <roger.odermatt@.nospam.swica.ch> wrote in message
news:uME3TRi%23EHA.1544@.TK2MSFTNGP11.phx.gbl...
> Hello
> I develop my reports local on my pc (VS2003, IIS5, SQL Server 2000 and
> ReportingServer are on the same Pc) and when i be finish then i want
> transfer the reports to official ReportingServer.
> Now my question witch files must transfer to the ReportingServer? And when
i
> transfer the files to another server then i think i must change the
> ReportingServer-Path, how can do that? I see that i can change the path in
> the VS-Project-Code, but can i do that purhaps with a Config-File or at
real
> time?
> Thank you very much
> Regards
> Roger
>