title: Printing and exporting from Crystal Reports Viewer throws error
body: <p>I'm using the .net Crystal Reports viewer to display a report in an asp.net Web form.  This works properly, but when I click on the print option, and then click "OK" on the options popup, I get the following error:</p>
  
  <blockquote>
    <p>Access is denied.<br>
    Description: An
    unhandled exception occurred during
    the execution of the current web
    request. Please review the stack trace
    for more information about the error
    and where it originated in the code.</p>
    
    <p>Exception Details:
    System.Runtime.InteropServices.COMException:
    Access is denied.</p>
  </blockquote>
  
  <p>And the same thing when I try to export.  I'm running this on the Visual Studio development server, VS2008.  What can I do to correct this?</p>
  
  <p>EDIT:</p>
  
  <p>Here is some code.   </p>
  
  <pre><code>        txtCategory:&amp;nbsp;
      &lt;asp:TextBox ID="txtCategory" runat="server"&gt;&lt;/asp:TextBox&gt;
      &lt;br /&gt;
      txtFromDate:&amp;nbsp;&amp;nbsp;&amp;nbsp;
      &lt;asp:TextBox ID="txtFromDate" runat="server" TabIndex="1"&gt;&lt;/asp:TextBox&gt;
      &lt;br /&gt;
      txtToDate:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
      &lt;asp:TextBox ID="txtToDate" runat="server" TabIndex="2"&gt;&lt;/asp:TextBox&gt;
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
      &lt;asp:Button ID="btnShowReport" runat="server" onclick="btnShowReport_Click" 
          TabIndex="4" Text="Show Report" /&gt;
      &lt;br /&gt;
      &lt;br /&gt;
      &lt;CR:CrystalReportSource ID="CrystalReportSource1" runat="server"&gt;
  
      &lt;/CR:CrystalReportSource&gt;
      &lt;CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" 
          AutoDataBind="True" DisplayGroupTree="False" EnableDatabaseLogonPrompt="False" 
          EnableParameterPrompt="False" HasRefreshButton="True" Height="50px" 
          ReportSourceID="CrystalReportSource1" Width="350px" /&gt;
  </code></pre>
  
  <p>And in Code-Behind:</p>
  
  <pre><code>protected void btnShowReport_Click(object sender, EventArgs e)
  {
      ReportDocument report = new ReportDocument();
      report.Load(Server.MapPath(@"~\ReportFiles\CrystalReport.rpt"));
  
      report.SetParameterValue("value1", txtCategory.Text);
  
      ParameterRangeValue dateRange = new ParameterRangeValue();
  
      CrystalReportViewer1.ReportSource = report;
  }
  
  
  
      STACKTRACE: at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object&amp; DocumentPath, Int32 Options) 
  at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object&amp; DocumentPath, Int32 Options) 
  at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
  </code></pre>