473,386 Members | 1,758 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,386 software developers and data experts.

How to Open report exported file in another window

I'm using this code to export the crystal report file into pdf format and
stream the file to the browser:

ReportDocument oRpt = new ReportDocument();
oRpt.Load(MapPath("MyReport.rpt"));
oRpt.SetDataSource(ds.Tables[0]);
Stream St = oRpt.ExportToStream(ExportFormatType.PortableDocFo rmat);

Response.ClearHeaders();
Response.ClearContent();
Response.ContentType = "Application/PDF";

Byte[] buffer = new Byte[St.Length];
St.Read(buffer, 0, (int) St.Length);
Response.BinaryWrite(buffer);
Response.End();

Everything works fine, but the pdf file is opened in the same browser
window.
Is it possible to open the pdf file in another window, without exporting the
file to disk first ?

// Ex: This also works (the pdf file is opened in another browser window),
but the file is exported to disk first.
oRpt.ExportToDisk(ExportFormatType.PortableDocForm at, LongFileName);
Response.Write("<script>window.open('"+Request.App licationPath+"/Files/"+Fil
eName+"');</script>");
Thanks

Nov 18 '05 #1
0 1299

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

Similar topics

3
by: wandali | last post by:
When I want to edit a MS Database, I have to run the following command: "C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" "\\Server\Directory\File.mdb" /wrkgrp...
0
by: lauren quantrell | last post by:
I have an Access 2000 application and I am using ShowWindow to hide the MS Access application window. Works fine as long as there is a popup form open all the time. The problem is when I want to...
3
by: eieed | last post by:
I have a web page that is designed to allow users to run crystal reports which are then exported into PDF formats. Currently, when the user clicks the "Submit" button there is some processing to...
1
by: Jason Huang | last post by:
Hi, Would someone tell me how to open a CrystalReport in my ASP.Net C#? We can use the Show method to open a windows form, but what method should we use for opening a CrystalReport? Thanks for...
6
by: Shamin | last post by:
Hi, Thanks in advance for answering to my Question. I'm stuck with this problem and would really appreciate any help. I have 2 aspx files (Main.aspx and ReportViewer.aspx). Main.aspx has a...
3
by: mo | last post by:
I have an application that uses Reporting Services. When the user chooses to print a report, they are taken to a window that allows them to fill in parameters for the report. They then click a...
2
by: Prasanta | last post by:
Hello, In my system the crystal report working till yesterday as well, but from today whenever I tried to open crystal report its asking me to log on to crystal management server, which never...
4
by: timmg | last post by:
I have an application were users evaluate records and based on the amount of money involved answer between 17 and a 120 questions on one of three response forms. I have a master list of question...
2
by: passterelli | last post by:
I have created a report that displays the contents of large memo fields. The report must be exported to MS Word (or .rtf) so the type style and type size can be modified according to the final user's...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...

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.