title: Crystal Reports load reportDocument failed
body: <p>I use crystal reports on vs 2010 c#, and i create pdf files using rpt documents of CR.</p>
  
  <p>I put this code on windows service,my code works normally for 30 - 40 times but then memory is rising per +5 +7 each progress.</p>
  
  <p>Last i get error like this: load file is failed !</p>
  
  <p>My code: (i think i dispose/close conn but how)</p>
  
  <pre><code>     private void ReportLogin(ReportDocument crDoc, string Database, string Server, string UserID, string Password)
      {
          try
          {
              crConnectionInfo = new ConnectionInfo();
              crConnectionInfo.ServerName = Server;
              crConnectionInfo.DatabaseName = Database;
              crConnectionInfo.UserID = UserID;
              crConnectionInfo.Password = Password;
  
              crDatabase = crDoc.Database;
              crTables = crDatabase.Tables;
  
              foreach (CrystalDecisions.CrystalReports.Engine.Table crTable in crTables)
              {
                  crTableLogonInfo = crTable.LogOnInfo;
                  crTableLogonInfo.ConnectionInfo = crConnectionInfo;
                  crTable.ApplyLogOnInfo(crTableLogonInfo);
              }
          }
          catch (Exception x)
          {
              throw x;
          }
      }
  
      private void _CrystalReport(string RptFilePath)
      {
  
          reportDocument = LoadDoc(RptFilePath);
  
          RptParamsWithType = new Dictionary&lt;string, string&gt;();
  
          if (reportDocument.ParameterFields.Count &gt; 0)
          {
              foreach (ParameterField pField in reportDocument.ParameterFields)
              {
                  RptParamsWithType.Add(pField.Name,              pField.ParameterValueType.ToString().Replace("Parameter", ""));
              }
          }
      }
  </code></pre>
  
  <p>Load Function:</p>
  
  <pre><code>    private ReportDocument LoadDoc(string RptFilePath)
      {
          try
          {
              reportDocument = new ReportDocument();
              reportDocument.Load(RptFilePath);
  
              return reportDocument;
  
          }
          catch (Exception x)
          {
              throw x;
          }
  
      }
  </code></pre>
  
  <p>My function that last called is create pdf:</p>
  
  <pre><code>     public MemoryStream asPdf
      {
          get
          {
              using (TempMemoryStream = (MemoryStream)reportDocument.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat))
              {
                  return TempMemoryStream;
              }
          }
      } 
  </code></pre>
  
  <p>Thanks Advice, help me plz</p>