This is a migrated thread and some comments may be shown as answers.

Directly open a exported pdf

1 Answer 228 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rainer Goos
Top achievements
Rank 1
Rainer Goos asked on 09 May 2008, 06:54 AM
I export a report directly to pdf and send it to the browser in that way:

private void ExportReport(Telerik.Reporting.Report Report)

{

string MimeType = string.Empty;

string Extension = string.Empty;

Encoding Encoding = null;

byte[] Buffer = ReportProcessor.Render("PDF", Report, null, out MimeType, out Extension, out Encoding);

Response.Clear();

Response.Buffer =

true;

Response.ContentType =

"application/pdf";

Response.AppendHeader(

"content-disposition", "attachment;filename=Report.pdf");

Response.BinaryWrite(Buffer);

Response.End();

}

In the IE i can directly open the pdf or save it. When i save it and then open it everything is okay. But when i click on open in the dialog my acrobat reader is executing but the message "file not found" show. What can i do. On an other client it works. I think it must be a client setting.

1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 09 May 2008, 08:02 AM
Hello Rainer Goos,

We assume that the problem is with the actual browser and not the produced PDF file, since it opens correctly on other browsers. We found an article describing a case exactly like yours and it seems that IE6 has problems with caching the file at certain occasions. One suggested workaround is removing the content disposition. Can you try that and see whether it will solve the problem. Also, you might want to look at an official Microsoft article concerning a similar behavior. Please, examine those pages and try the different suggestions there.

Another possible way to work around this might be changing the content disposition from "attachment" to "inline".

Greetings,
Ross
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
Rainer Goos
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or