472,782 Members | 1,280 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,782 software developers and data experts.

asp.net app calling Reporting Services cannot open file

Good afternoon,

I have what appears to be a caching issue, but i'm a bit of a newbie at
http headers so it may be something else.

I have a small asp.net 2.0 application that is called to serve up some
SQL Reporting Services reports. The asp pages are running under SSL as
are the pages that call the asp app.

The asp app runs correctly, but the reports cannot be opened or saved.
I get a "The page cannot be displayed" error.

I am thinking that this is due to caching, as detailed in this MS KB
article: http://support.microsoft.com/kb/316431

I have
Response.ClearHeaders()
and then

Response.AppendHeader("Cache-control",
"public,max-age=1")
Response.ContentType = strContentType
Response.BinaryWrite(bytResult)
Response.Flush()
Response.Close()

where strContentType is defined as "application/octet-stream" and
bytResult is the Byte result of calling the render method.

I have tried using logic to use application/vnd.ms-excel or
application/pdf when applicable instead of application/octet-stream,
but that doesn't help. I

The code originally had
'Response.AppendHeader("Content-Disposition",
"attachment;filename=" + strAttachName) which was to force a download,
but we really don't want the users to save the reports; we would prefer
to have them just view them. As I understand things,
Content-Disposition is used to force the file download box, which I
don't want. I just want the files to open. Do I need to use something
in place of
'Response.AppendHeader("Content-Disposition",
"attachment;filename=" + strAttachName)
when I don't want a file download.

According to the KB article, I need to get rid of the Pragma:no-cache
that is coming across in the response header, but since no-cache is the
only value possible for pragma, I don't know how to do that. I tried
adding Response.AppendHeader("Pragma","") but that didn't work.

Here is the Response Header:

HTTP/1.1 200 OK
Connection: close
Date: Wed, 18 Oct 2006 17:22:27 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Expires: 0
Pragma: no-cache
Cache-control: no-cache,max-age=0,must-revalidate
X-AspNet-Version: 2.0.50727
Cache-Control: public,max-age=1
Content-Type: application/octet-stream

I believe that my ":Cache-Control: public,max-age=1" is overriding both
the "Cache-control: no-cache,max-age=0,must-revalidate" and the
"Expires=0", but I can't get rid of Pragma: no-cache

Any ideas, references, resources, sample code or encouraging words
would be greatly appreciated.

Thanks,
Kathryn

Oct 18 '06 #1
2 2870
What control are you using to display the Report? Are you using the SQL
Reporting Services Report Viewer control?

--
Ameet Phadnis
Sr. Technical Consultant
e Tek Global Inc.
ASP Alliance Author Page: http://aspalliance.com/author.aspx?uId=44260
"kbutterly" wrote:
Good afternoon,

I have what appears to be a caching issue, but i'm a bit of a newbie at
http headers so it may be something else.

I have a small asp.net 2.0 application that is called to serve up some
SQL Reporting Services reports. The asp pages are running under SSL as
are the pages that call the asp app.

The asp app runs correctly, but the reports cannot be opened or saved.
I get a "The page cannot be displayed" error.

I am thinking that this is due to caching, as detailed in this MS KB
article: http://support.microsoft.com/kb/316431

I have
Response.ClearHeaders()
and then

Response.AppendHeader("Cache-control",
"public,max-age=1")
Response.ContentType = strContentType
Response.BinaryWrite(bytResult)
Response.Flush()
Response.Close()

where strContentType is defined as "application/octet-stream" and
bytResult is the Byte result of calling the render method.

I have tried using logic to use application/vnd.ms-excel or
application/pdf when applicable instead of application/octet-stream,
but that doesn't help. I

The code originally had
'Response.AppendHeader("Content-Disposition",
"attachment;filename=" + strAttachName) which was to force a download,
but we really don't want the users to save the reports; we would prefer
to have them just view them. As I understand things,
Content-Disposition is used to force the file download box, which I
don't want. I just want the files to open. Do I need to use something
in place of
'Response.AppendHeader("Content-Disposition",
"attachment;filename=" + strAttachName)
when I don't want a file download.

According to the KB article, I need to get rid of the Pragma:no-cache
that is coming across in the response header, but since no-cache is the
only value possible for pragma, I don't know how to do that. I tried
adding Response.AppendHeader("Pragma","") but that didn't work.

Here is the Response Header:

HTTP/1.1 200 OK
Connection: close
Date: Wed, 18 Oct 2006 17:22:27 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Expires: 0
Pragma: no-cache
Cache-control: no-cache,max-age=0,must-revalidate
X-AspNet-Version: 2.0.50727
Cache-Control: public,max-age=1
Content-Type: application/octet-stream

I believe that my ":Cache-Control: public,max-age=1" is overriding both
the "Cache-control: no-cache,max-age=0,must-revalidate" and the
"Expires=0", but I can't get rid of Pragma: no-cache

Any ideas, references, resources, sample code or encouraging words
would be greatly appreciated.

Thanks,
Kathryn

Oct 18 '06 #2
Ameet,

Thanks for the reply! No we are not useing the Report View control.

The asp app functions as follows: the aspx page receives a GUID as a
URL parameter. In the page_Load event, it then passes the GUID into a
stored procedure that returns the parameters for the report.

The report is then loaded using the LoadReport method, then the
parameters are set using the SetExecutionParameters method.

The Render method is then called and then the follow code is called:

Response.AppendHeader("Cache-control",
"public,max-age=1")
Response.ContentType = strContentType
Response.BinaryWrite(bytResult)
Response.Flush()
Response.Close()
I am the third developer to work on this and I am pretty much an asp
newbie. Any ideas would be greatly appreciated.

Thanks,
Kathryn
Ameet Phadnis (e Tek Global Inc.) wrote:
What control are you using to display the Report? Are you using the SQL
Reporting Services Report Viewer control?

--
Ameet Phadnis
Sr. Technical Consultant
e Tek Global Inc.
ASP Alliance Author Page: http://aspalliance.com/author.aspx?uId=44260
"kbutterly" wrote:
Good afternoon,

I have what appears to be a caching issue, but i'm a bit of a newbie at
http headers so it may be something else.

I have a small asp.net 2.0 application that is called to serve up some
SQL Reporting Services reports. The asp pages are running under SSL as
are the pages that call the asp app.

The asp app runs correctly, but the reports cannot be opened or saved.
I get a "The page cannot be displayed" error.

I am thinking that this is due to caching, as detailed in this MS KB
article: http://support.microsoft.com/kb/316431

I have
Response.ClearHeaders()
and then

Response.AppendHeader("Cache-control",
"public,max-age=1")
Response.ContentType = strContentType
Response.BinaryWrite(bytResult)
Response.Flush()
Response.Close()

where strContentType is defined as "application/octet-stream" and
bytResult is the Byte result of calling the render method.

I have tried using logic to use application/vnd.ms-excel or
application/pdf when applicable instead of application/octet-stream,
but that doesn't help. I

The code originally had
'Response.AppendHeader("Content-Disposition",
"attachment;filename=" + strAttachName) which was to force a download,
but we really don't want the users to save the reports; we would prefer
to have them just view them. As I understand things,
Content-Disposition is used to force the file download box, which I
don't want. I just want the files to open. Do I need to use something
in place of
'Response.AppendHeader("Content-Disposition",
"attachment;filename=" + strAttachName)
when I don't want a file download.

According to the KB article, I need to get rid of the Pragma:no-cache
that is coming across in the response header, but since no-cache is the
only value possible for pragma, I don't know how to do that. I tried
adding Response.AppendHeader("Pragma","") but that didn't work.

Here is the Response Header:

HTTP/1.1 200 OK
Connection: close
Date: Wed, 18 Oct 2006 17:22:27 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Expires: 0
Pragma: no-cache
Cache-control: no-cache,max-age=0,must-revalidate
X-AspNet-Version: 2.0.50727
Cache-Control: public,max-age=1
Content-Type: application/octet-stream

I believe that my ":Cache-Control: public,max-age=1" is overriding both
the "Cache-control: no-cache,max-age=0,must-revalidate" and the
"Expires=0", but I can't get rid of Pragma: no-cache

Any ideas, references, resources, sample code or encouraging words
would be greatly appreciated.

Thanks,
Kathryn
Oct 19 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: ferit meftun harmankaya | last post by:
I have some report which are designed in "Crystal Report". I want to run these reports in "Reporting Service" My aim is to convert from extension of Crystal Report (rpt) to extension of reporting...
3
by: Mohammad S Khan | last post by:
I am currently doing some research on reporting features provided / compatible with dotnet features. Our current application has excel reprots that are emailed both with an without scheduling...
4
by: Fabian von Romberg | last post by:
Hi, I have installed Sql Reporting Services on 2 machines, one is WIN 2000 PRO and the other one is WIN 2000 ADV. SERVER. When I try to access a report using the webbrowser, I get the following...
0
by: Josef.Szeliga | last post by:
I have a most unusual problem that i cannot work out. I have a pie chart on my report which when you click on one of the pieces calls itself and drills down into the data. This method works...
1
by: iThinkData | last post by:
Should these 3 items, .Net 2.0 Website, SQLServer 2005, Reporting Services 2005. all reside on the same computer? I know that the website issues a configuration error saying it can't find...
1
by: rmk | last post by:
How can I get the 2000 and 2005 versions of SQL Server Reporting Services both working on my development laptop ????? I have ASP.NET 1.1 and 2.0 installed on my laptop. I have Visual Studio...
1
by: YellowfinTeam | last post by:
Marketplace: Yellowfin reporting 3.1 with BIRT Integration Yellowfin is proud to announce the release of 3.1. The major theme of this release is enhanced integration capability. We have...
0
by: fperri | last post by:
Hi, I am trying to configure reporting services which I just added to an already existing installation of SQL Server 2005. When I am in the reporting services configuration manager and I am trying...
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.