Skip to Content
Jul 24, 2008 at 10:19 PM

Printing/Exporting Issue in IE 7 with CrystalReportViewer control


I just recently setup my site to use the CrystalReportViewer control offered in I have worked through all of the setup and configuration issues, which was a good time. I am currently stuck trying to getting around IE 7 from blocking the file download when you try and print or export from the viewer control.

Crazy part is it works fine one my localhost when testing out of Visual Studio 05. I never get the download warning in IE 7. However, when I post it to the server I get the warning dropdown. I have dealt with this issue before when streaming files from the server to the client by using:

Response.AddHeader("content-disposition", "attachment;filename=Sales Report.xls")    
' Set MIME type to Excel.
Response.ContentType = "application/"    
' Remove the charset from the Content-Type header.
Response.Charset = "" 
Response.Write(string or whatever goes here) 

I will say that all of my pages use AJAX, but I have removed all the ajax references from my test page. So this should not be an issue.

Test page code:

<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" AutoEventWireup="false" %>
<%@ Register TagPrefix="CR" Namespace="CrystalDecisions.Web" Assembly="CrystalDecisions.Web, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "">
<html xmlns="" >
<head runat="server">
<title>Report Window</title>
   <form id="form1" runat="server">
        <CR:CrystalReportViewer ID="CrystalReportViewer1" Runat="server" AutoDataBind="True"
            Height="1158px" ReportSourceID="CrystalReportSource1" Width="1059px" GroupTreeImagesFolderUrl="" ToolbarImagesFolderUrl="" ToolPanelWidth="200px" Style="z-index: 64; left: 0px; position: absolute; top: 0px" />      
        <CR:CrystalReportSource ID="CrystalReportSource1" runat="server">
            <Report FileName="EstActionList.rpt">

How can I prevent IE7 from giving my users a download warning? And I want to do this in code, not by changing the settings in IE7.