Crystal Report not opening in a new page

G

Guest

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.AppSettings["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);
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top