473,763 Members | 6,149 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Crystal Report not opening in a new page

Help me please,
I'm creating an excel crystal report.
The problem is that it is opening in the browser instead of in its own page.
I have done this many times and it had worked just fine.
I think the problem is that this project is in a frameset.
Could that be causing the problem?
Any help would be appreciated.
A code snippet follows:

ReportDocument crpt = new ReportDocument( );
crpt.SetDataSou rce(ds);
ExcelFormatOpti ons excelFormatOpts = new ExcelFormatOpti ons();
excelFormatOpts .ExcelTabHasCol umnHeadings = true;
excelFormatOpts .ExcelUseConsta ntColumnWidth = false;
crpt.ExportOpti ons.FormatOptio ns = excelFormatOpts ;
string tempfilename =
System.Configur ation.Configura tionSettings.Ap pSettings["TempDir"] +
Session.Session ID.ToString() + ".xsl";

crDiskFileDesti nationOptions.D iskFileName = tempfilename;
crpt.ExportOpti ons.Destination Options = crDiskFileDesti nationOptions;
crpt.ExportOpti ons.ExportDesti nationType = ExportDestinati onType.DiskFile ;
crpt.ExportOpti ons.ExportForma tType = ExportFormatTyp e.Excel;

crpt.Export();
Response.ClearC ontent();
Response.ClearH eaders();
Response.Conten tType = "applicatio n/vnd.ms-excel";

Response.WriteF ile(tempfilenam e);
Response.Flush( );
Response.Close( );
System.IO.File. Delete(tempfile name);
Mar 22 '06 #1
1 1685
Hi John,

If you mean to popup a window to show excel, you should have another page to
show excel. And in export page, have javascript code to popup that page (put
tempfilename in query string).

HTH

Elton Wang

"John" wrote:
Help me please,
I'm creating an excel crystal report.
The problem is that it is opening in the browser instead of in its own page.
I have done this many times and it had worked just fine.
I think the problem is that this project is in a frameset.
Could that be causing the problem?
Any help would be appreciated.
A code snippet follows:

ReportDocument crpt = new ReportDocument( );
crpt.SetDataSou rce(ds);
ExcelFormatOpti ons excelFormatOpts = new ExcelFormatOpti ons();
excelFormatOpts .ExcelTabHasCol umnHeadings = true;
excelFormatOpts .ExcelUseConsta ntColumnWidth = false;
crpt.ExportOpti ons.FormatOptio ns = excelFormatOpts ;
string tempfilename =
System.Configur ation.Configura tionSettings.Ap pSettings["TempDir"] +
Session.Session ID.ToString() + ".xsl";

crDiskFileDesti nationOptions.D iskFileName = tempfilename;
crpt.ExportOpti ons.Destination Options = crDiskFileDesti nationOptions;
crpt.ExportOpti ons.ExportDesti nationType = ExportDestinati onType.DiskFile ;
crpt.ExportOpti ons.ExportForma tType = ExportFormatTyp e.Excel;

crpt.Export();
Response.ClearC ontent();
Response.ClearH eaders();
Response.Conten tType = "applicatio n/vnd.ms-excel";

Response.WriteF ile(tempfilenam e);
Response.Flush( );
Response.Close( );
System.IO.File. Delete(tempfile name);

Mar 23 '06 #2

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

Similar topics

6
13142
by: Robin Cushman | last post by:
Hi all, I need some help -- I'm working with an A2K database, using DAO, and am trying to read records into a Crystal Report and then export it to a folder on our network as an Excel spreadsheet. I'm having trouble with my code at the point at which it hits ".ReadRecords" -- the module just runs and runs without generating anything. I've gotten this code to correctly save .rpt files without any data, but not with data, nor have I been...
1
2783
by: rdshultz | last post by:
My company is going to a new software were I have to learn Crystal Reports. Had my first class and I'm a little confused. The instructor said everytime you run a Crystal report you have to do a "Refresh" if you want the most current data from the tables and that the data stays on your computer. I want the most current data everytime the user runs a report without having to do a "Refresh" and I would think that all that data residing on...
1
12178
by: Karthic | last post by:
When i right click on the .rpt file in the VS 2003, i see a property printer setting. It says "No printer" on the top and there is option to select printer and paper settings etc.. I want to know how will this affect a report rendered by a crystal viewer. I have a web page with a crystal viewer rendering the report on the page. I build my application in one of my development machines and deploy it
2
7154
by: Pramod | last post by:
Hello All We have application here. That utilizes the CrsytalReport.net. We have initial version installed on Production server where all report pages opening fine. Now we have added some changes apart from report and compiled soluion and put that code on production first page of report gives error 'Fail to render page.' Root cause i found out i.e. because of image on that page but other pages work fine as there are no images on that. But if we...
19
3881
by: LP | last post by:
I am using (trying to) CR version XI, cascading parameters feature works it asks user to enter params. But if page is resubmitted. It prompts for params again. I did set ReuseParameterValuesOnRefresh="True" in a viewer, but it still doesn't work. Did anyone run into this problem. What's the solution? Please help. Thank you
0
291
by: project | last post by:
I want to print an sales invoice with out open crystal report. I want to know ,with out opening Crystal report, how can I give the command to be printing invoice. I'm using the following lines to open a crystal report Dim myreport as new reportdocument() Dim Rptfrm as new project1.reportfrm()
3
3571
by: David P. Donahue | last post by:
Maybe this is an easy thing to do, but I'm just not seeing how it's done (or at least how it's done properly). I have a web service running on a remote machine which returns a DataSet. I can easily write an xsd file to define that DataSet, if need be. Now, on a local Windows Forms application, I need to have a CrystalReportViewer open up a Crystal Report which needs to get its data from that Web Service. How would this be done? It's...
5
3738
by: jmar | last post by:
I posted a week ago and received one response. I'm looking for the opinion of several experienced .NET people before I proceed so I'm posting again. Sorry for the repost... I am updating a VB4.0 quote generation program to VB.net. The old program takes user inputs, performs calculations, saves the data to Access databases and uses Crystal Reports 5.0 to generate a quote. A while back users obviously wanted to be able to edit/e-mail ...
1
2195
by: mike11d11 | last post by:
For some reason I'm getting no data populating in my crystal report. I built my crystal report off my dataset in my project, and I fill the dataset when opening the main form, and count the records just to make sure there is data in the dataset, and then open the form containing my reportviewer control with the crystal report added to it and it still shows no data when it opens. I built my crystal report off the wizard when right...
0
9563
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
9386
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
8821
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7366
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...
0
6642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3917
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
3
3522
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.