473,406 Members | 2,312 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,406 software developers and data experts.

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.SetDataSource(ds);
ExcelFormatOptions excelFormatOpts = new ExcelFormatOptions();
excelFormatOpts.ExcelTabHasColumnHeadings = true;
excelFormatOpts.ExcelUseConstantColumnWidth = false;
crpt.ExportOptions.FormatOptions = excelFormatOpts;
string tempfilename =
System.Configuration.ConfigurationSettings.AppSett ings["TempDir"] +
Session.SessionID.ToString() + ".xsl";

crDiskFileDestinationOptions.DiskFileName = tempfilename;
crpt.ExportOptions.DestinationOptions = crDiskFileDestinationOptions;
crpt.ExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
crpt.ExportOptions.ExportFormatType = ExportFormatType.Excel;

crpt.Export();
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "application/vnd.ms-excel";

Response.WriteFile(tempfilename);
Response.Flush();
Response.Close();
System.IO.File.Delete(tempfilename);
Mar 22 '06 #1
1 1659
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.SetDataSource(ds);
ExcelFormatOptions excelFormatOpts = new ExcelFormatOptions();
excelFormatOpts.ExcelTabHasColumnHeadings = true;
excelFormatOpts.ExcelUseConstantColumnWidth = false;
crpt.ExportOptions.FormatOptions = excelFormatOpts;
string tempfilename =
System.Configuration.ConfigurationSettings.AppSett ings["TempDir"] +
Session.SessionID.ToString() + ".xsl";

crDiskFileDestinationOptions.DiskFileName = tempfilename;
crpt.ExportOptions.DestinationOptions = crDiskFileDestinationOptions;
crpt.ExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
crpt.ExportOptions.ExportFormatType = ExportFormatType.Excel;

crpt.Export();
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "application/vnd.ms-excel";

Response.WriteFile(tempfilename);
Response.Flush();
Response.Close();
System.IO.File.Delete(tempfilename);

Mar 23 '06 #2

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

Similar topics

6
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...
1
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...
1
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...
2
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...
19
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...
0
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...
3
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...
5
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...
1
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...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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.