473,401 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 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 2900
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.