///// <summary> ///// ///// </summary> ///// <param name="dataSource"></param> ///// <param name="dataMember"></param> //public void SetDataBinding(object dataSource, string dataMember) //{ // foreach (DataTable i in m_ds.Tables) // { // i.Rows.Clear(); // } // DataTable dt = dataSource as DataTable; // if (dt != null) // { // foreach (DataRow row in dt.Rows) // { // DataRow newRow = m_ds.Tables[0].NewRow(); // foreach (DataColumn col in m_ds.Tables[0].Columns) // { // newRow[col.ColumnName] = row[col.ColumnName]; // } // m_ds.Tables[0].Rows.Add(newRow); // } // } // else // { // IEnumerable list = dataSource as IEnumerable; // if (list != null) // { // foreach (object row in list) // { // DataRow newRow = m_ds.Tables[0].NewRow(); // foreach (DataColumn col in m_ds.Tables[0].Columns) // { // newRow[col.ColumnName] = EntityHelper.GetPropertyValue(row, col.ColumnName); // } // m_ds.Tables[0].Rows.Add(newRow); // } // } // else // { // throw new NotSupportedException("MyCrystalReportViewer only support DataTable and IList now!"); // } // } // _crystalHelper.DataSource = m_ds; // OpenReport(); //} /// <summary> /// /// </summary> public void OpenReport() { if (_crystalHelper.IsOpen) { _crystalHelper.Close(); } _crystalHelper.Open(); this.ReportSource = _crystalHelper.ReportSource; }
/// <summary> /// /// </summary> public void OpenReport() { // if closed, can't be reopened; //if (_crystalHelper.IsOpen) //{ // _crystalHelper.Close(); //} _crystalHelper.Open(); this.ReportSource = _crystalHelper.ReportSource; }