title: Load report failed, If put SQL Command in place otherwise FormLoad
body: <p>I have CrystalReport page, The below code is just load one time through FormLoad and by using !Page.IsPostBack and If I try to reload it again give me error "Load report failed."</p>
  
  <pre><code>  if (!Page.IsPostBack)
       {
          cmd = new SqlCommand("SELECT * FROM [tbJournals]", cnn);
          cnn.Open();
          da = new SqlDataAdapter(cmd);
          dt = new DataTable("tbl");
          da.Fill(dt);
          cnn.Close();
  
          _rdStudents = new ReportDocument();
          _rdStudents.Load(Server.MapPath("~\\Accounting\\Journal_Report.rpt"));
          _rdStudents.SetDatabaseLogon("sa", "password", ".\\SQLEXPRESS", "GoldenDeveloper");
          _rdStudents.SetDataSource(dt);
          CrystalReportViewer1.ReportSource = _rdStudents;
          CrystalReportViewer1.RefreshReport();
       }
  </code></pre>
  
  <p>But What I want to do put this code under CommandButton to change in search variable to make SQL Statement for example like that</p>
  
  <pre><code>SELECT * FROM [tbJournals] where [Date] = '"+ txtDate.Text +"'
  </code></pre>
  
  <p>But once I put the code instead of FormLoad to CommandButton give me error "Load report failed."</p>
  
  <p>Thanks In Advance ....</p>