Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 21st, 2005, 6:57 PM   #1
see07
Programmer
 
Join Date: Oct 2004
Posts: 37
Rep Power: 0 see07 is on a distinguished road
Talking How Avoid Dialog Box Open/Save Files

Hello:
I知 sending a Crystal Reports痴 report to Word, but a dialog box is opening where user is asking if wish open/save file.
I壇 like avoid this dialog emerges and report be displayed directly in screen as user would press open button.
I知 attaching code I知 using:

string ExportPath = sRuta + "CrystalReport1" + ".doc";

crvReportes.ReportSource = cr;
CrystalDecisions.Shared.DiskFileDestinationOptions DiskOpts = new CrystalDecisions.Shared.DiskFileDestinationOptions();

cr.ExportOptions.ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile;

cr.ExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.WordForWindows;
DiskOpts.DiskFileName = ExportPath;

cr.ExportOptions.DestinationOptions = DiskOpts;

cr.Export();
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "application/msword";
Response.WriteFile(ExportPath);
Response.Flush();
Response.Close();
System.IO.File.Delete(ExportPath);

Where crvReportes is my CrystalReportViewer y cr is my ReoprtDocument
I値l thank your help.
A.L.
__________________
<span style='color:red'>El Hombre que tiene Amigos, debe mostrarse Amigo...</span>
see07 is offline   Reply With Quote
Old Feb 22nd, 2005, 1:21 PM   #2
see07
Programmer
 
Join Date: Oct 2004
Posts: 37
Rep Power: 0 see07 is on a distinguished road
Hello:
Surely I need to be more explicit.
I'm trying to export a report from a CrystalReportViewer to a location within client machine, I write it therein and then I want display it imto web page, I want avoid dialgog box asking if user want open or save file. I want that it be displayed into a web form without such a dialog, if instead Word document I export it to .pdf format it is displayed directly without such a dialog.
How can I achieve it in Word?
A.L.
__________________
<span style='color:red'>El Hombre que tiene Amigos, debe mostrarse Amigo...</span>
see07 is offline   Reply With Quote
Old Feb 23rd, 2005, 6:36 PM   #3
see07
Programmer
 
Join Date: Oct 2004
Posts: 37
Rep Power: 0 see07 is on a distinguished road
Code I知 using is:

Response.ClearContent();
Response.ClearHeaders();
Response.Clear();
Response.ContentType = "application/msword";
Response.Charset = "";

Response.AddHeader("Content-disposition", "inline; filename=ExportPath");
Response.AddHeader("Content-Length", sFileLength);

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

If file to display was not MS-Word neither MS-Excel, as a PDF file, then dialog box is not showed.

How can I in MS files to such dialog not be showed?

A.L.
__________________
<span style='color:red'>El Hombre que tiene Amigos, debe mostrarse Amigo...</span>
see07 is offline   Reply With Quote
Old Mar 30th, 2005, 8:06 AM   #4
sarav
Newbie
 
Join Date: Mar 2005
Posts: 5
Rep Power: 0 sarav is on a distinguished road
I have a similar problem

Hi see07,
I have a similar problem: I made the same code that you have show in this thread, but Internet Explorer don't ask me if I want to download as it does to you. It opens a new Explorer window with a rule as ms-word but not buttons (is a Explorer window, not really ms-word) showing a blank ms-word page. No error message, just this blank document.
Have you find a solution for your situation?
sarav is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:05 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC