473,614 Members | 2,361 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PDF rendering

Hi there!

We are rendering some PDF reports from an ASP.NET application, directly
to the IE browser. Those reports are beign generated from a SQL
Reporting Services server. We have the requirement of displaying the
reports inside the browser. In order to do that, we have this:

Response.ClearC ontent();
Response.ClearH eaders();
Response.Append Header("content-length", reportData.Leng th.ToString());
Response.Append Header("content-disposition", "inline;
filename=SalesR eport.pdf");
Response.Conten tType = "applicatio n/pdf";
Response.Binary Write(reportDat a);
Response.Flush( );
Response.Close( );

The report shows perfectly. But our problem is that inside the Acrobat
Reader "sub window" on the browser, if the user clicks "Send By Email",
the reader creates an outlook email with an attachment called
"Report.ASP X". This one is the ASPX page used for rendering the report,
instead the "SalesReport.pd f" name suggested in the headers. Of course,
the customers complains about seeing garbage when looking at the attach
(really a PDF file, with the wrong extension).

Is there are any other way to indicate the filename to IE? Any ideas or
workaround on this?

Any suggestion is really appreciated. Thanks a ton in advance!!!

Dec 30 '05 #1
6 1771
I think you need something like this, specificying an attachment rather than
just a filename

Response.AddHea der("Content-Disposition", "attachment ; filename=fred.p df")

--
Regards

John Timney
Microsoft MVP

"Nautilus" <ma************ @gmail.com> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.com.. .
Hi there!

We are rendering some PDF reports from an ASP.NET application, directly
to the IE browser. Those reports are beign generated from a SQL
Reporting Services server. We have the requirement of displaying the
reports inside the browser. In order to do that, we have this:

Response.ClearC ontent();
Response.ClearH eaders();
Response.Append Header("content-length", reportData.Leng th.ToString());
Response.Append Header("content-disposition", "inline;
filename=SalesR eport.pdf");
Response.Conten tType = "applicatio n/pdf";
Response.Binary Write(reportDat a);
Response.Flush( );
Response.Close( );

The report shows perfectly. But our problem is that inside the Acrobat
Reader "sub window" on the browser, if the user clicks "Send By Email",
the reader creates an outlook email with an attachment called
"Report.ASP X". This one is the ASPX page used for rendering the report,
instead the "SalesReport.pd f" name suggested in the headers. Of course,
the customers complains about seeing garbage when looking at the attach
(really a PDF file, with the wrong extension).

Is there are any other way to indicate the filename to IE? Any ideas or
workaround on this?

Any suggestion is really appreciated. Thanks a ton in advance!!!

Dec 30 '05 #2
Hi John! Many thanks for the input!

Unfortunately, that produces that IE treat that as an attachment,
displaying the "Save As / Open" dialog... and we need to display the
PDF right inside the browser window.

That's why we tried with the "inline" option... :(

Thanks again!

Best!
Mariano

Dec 30 '05 #3
You could try adding a 'name' parameter to your Content-Type:

Response.Conten tType = "applicatio n/pdf; name=SalesRepor t.pdf";

Dec 30 '05 #4
Hi there!

Many thanks for the input again! I just tried that, and now IE just
doesn't display anything... :(

It's very frustrating that IE doesn't well interpret the
"content-disposition" headers, and pass that to Acrobat.. as it should
be. I keep trying any kind of workarounds, like using a
"Report.pdf.asp x" page, but it's the same.

Thanks a ton to all!
Mariano

Dec 30 '05 #5
Why not write the report to disk with a correct filename and then point the
browser at the file. If you need to insure a unique name, you could create a
directory with a based name and then write the pdf inside of that
directory.

--

Andrew Robinson
www.binaryocean.com
www.bellinghamdotnet.org
"Nautilus" <ma************ @gmail.com> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.com.. .
Hi there!

We are rendering some PDF reports from an ASP.NET application, directly
to the IE browser. Those reports are beign generated from a SQL
Reporting Services server. We have the requirement of displaying the
reports inside the browser. In order to do that, we have this:

Response.ClearC ontent();
Response.ClearH eaders();
Response.Append Header("content-length", reportData.Leng th.ToString());
Response.Append Header("content-disposition", "inline;
filename=SalesR eport.pdf");
Response.Conten tType = "applicatio n/pdf";
Response.Binary Write(reportDat a);
Response.Flush( );
Response.Close( );

The report shows perfectly. But our problem is that inside the Acrobat
Reader "sub window" on the browser, if the user clicks "Send By Email",
the reader creates an outlook email with an attachment called
"Report.ASP X". This one is the ASPX page used for rendering the report,
instead the "SalesReport.pd f" name suggested in the headers. Of course,
the customers complains about seeing garbage when looking at the attach
(really a PDF file, with the wrong extension).

Is there are any other way to indicate the filename to IE? Any ideas or
workaround on this?

Any suggestion is really appreciated. Thanks a ton in advance!!!

Dec 31 '05 #6
Hi Andrew!

Yes, that would be our last chance... But we are trying to avoid it
because of "performanc e" problems. In order to have the same
"SalesActivitie s.pdf" name for each report request, we would need to
create a folder (for example based on a GUID), and put the file
there... and of course, add some background process for erasing the
files, and removing the folders.. :)

At this point, I'm thinking in pushing to change the requirement, and
leave this as is.

Many thanks to all!

Jan 2 '06 #7

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

Similar topics

1
2094
by: eeyimaya | last post by:
Hello, I read from sun site about fullscreen mode and active rendering and now I am in doubt! is active rendering for only fullscreen applications? I am planning to develop an windowed application using swing and it will include a lot of animations on each frame... Can I use active rendering still? What is the best way of improving animation speed? Or just calling the repaint() when the screen changes is enough? (Of course I will use...
6
3014
by: David Opstad | last post by:
I have a question about text rendering I'm hoping someone here can answer. Is there a way of doing linguistically correct rendering of Unicode strings in Python? In simple cases like Latin or Japanese I can just print the string and see the correct results. However, I don't know how to get Python to do the right thing for writing systems which require contextual processing. For example, let's say I create this Unicode string in Arabic: ...
3
1764
by: Beetlegeuse | last post by:
Here is a screenshot of three different versions of rendering of the trouble area: http://img371.imageshack.us/img371/2572/layout8xg.gif (ignore the language of the text) The first rendering is the weirdest one -- the background and border of the items (placed within span tags) are
3
3024
by: David Whitney | last post by:
All: I have a control that renders a table. As the table is rendered, each row in the table is constructed by creating a run-time (dynamic) object that is derived from an HtmlTableRow. The row has three HtmlTableCell objects, and each cell contains a single control added to the HtmlTableCell's Controls collection. The basic table renders correctly, but the controls within the HtmlTableCell objects do not; the cells are just empty. (Just...
5
2622
by: Dave A | last post by:
I am writing an ASP.NET tool that will allow the client to create their own online froms. ie the client can add tect boxes, text, drop downs,etc with absolutely no technical skill what so ever. The form can then be deployed to their intranet. The form designer is somewhat WYSIWYG but it contains a heap of 'edit', 'delete' and reordering buttons that are not seen when the form is acutally being used. I would love to have a preview...
4
4114
by: tobfon | last post by:
I'm creating a scientific visualization application with rather high demands on performance. I've created a nice rendering engine for it in C++/OpenGL and a python interface to the rendering engine. Now I'm looking to build a GUI in python with the rendering engine as an integrated window. I will most likely use wxPython for the GUI and I know it has support for adding an OpenGL canvas. After looking around in these groups and others it...
3
10097
by: ramesh | last post by:
Hi all, I am facing a problem with the rendering of html into a windows application (C# .NET). I am trying with two possible approaches: 1. Use a control that directly renders the html into windows form, but it should not be dependent on IE or mshtml. I didn't get such kind of control so far. Can any one help on this? 2. Use a third party Html to Rtf converter and render the rtf in
0
1421
by: Juan R. | last post by:
Since the idea of encoding mathematics using MathML is being very far from popular due to a number of factors -expensive tools, bad accesibility of generated code, unusual verbosity, lack of adequate support, special fonts, namespaces, special plugins, backward incompatiblity of MathML with other internet technologies, duplication of code, and others-, alternative encodings are spreading over the internet. Probably the most popular one...
5
2328
by: paul.hester | last post by:
Hi all, I have a custom control with an overridden Render method. Inside this method I'm rendering each control in its collection using their RenderControl method. However, I'm running into a problem in this scenario: <myprefix:mycontrol runat="server"> <%= SomeVariable %> </myprefix:mycontrol>
12
2838
by: Boris Borcic | last post by:
Hello, I am trying to use UI Automation to drive an MS Windows app (with pywinauto). I need to scrape the app's window contents and use some form of OCR to get at the texts (pywinauto can't get at them). As an alternative to integrating an OCR engine, and since I know the fonts and sizes used to write on the app's windows, I reasoned that I could base a simple text recognition module on the capability to drive MSWindows text...
0
8179
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8124
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8576
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8272
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8427
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6087
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
2565
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1712
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1421
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.