Пример #1
0
        /// <inheritdoc/>
        public override void Serialize(FRWriter writer)
        {
            DataFilterBaseControl c = writer.DiffObject as DataFilterBaseControl;

            base.Serialize(writer);

            if (AutoFill != c.AutoFill)
            {
                writer.WriteBool("AutoFill", AutoFill);
            }
            if (AutoFilter != c.AutoFilter)
            {
                writer.WriteBool("AutoFilter", AutoFilter);
            }
            if (DataColumn != c.DataColumn)
            {
                writer.WriteStr("DataColumn", DataColumn);
            }
            if (ReportParameter != c.ReportParameter)
            {
                writer.WriteStr("ReportParameter", ReportParameter);
            }
            if (FilterOperation != c.FilterOperation)
            {
                writer.WriteValue("FilterOperation", FilterOperation);
            }
            if (DetailControl != c.DetailControl)
            {
                writer.WriteRef("DetailControl", DetailControl);
            }
            if (DataLoadedEvent != c.DataLoadedEvent)
            {
                writer.WriteStr("DataLoadedEvent", DataLoadedEvent);
            }
        }
Пример #2
0
 /// <summary>
 /// Fills the control with data from a datasource.
 /// </summary>
 /// <param name="parentControl">Parent control</param>
 /// <remarks>
 /// Call this method if you need to implement cascaded filter. In the <b>parentControl</b> parameter,
 /// pass the parent control which performs filtering on a parent data source.
 /// </remarks>
 public void FillData(DataFilterBaseControl parentControl)
 {
     if (!String.IsNullOrEmpty(parentControl.DataColumn))
     {
         Column dataColumn = DataHelper.GetColumn(Report.Dictionary, parentControl.DataColumn);
         if (dataColumn != null)
         {
             DataSourceBase dataSource = dataColumn.Parent as DataSourceBase;
             FillData(dataSource);
         }
     }
 }
Пример #3
0
        private void Form_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (FForm.DialogResult == DialogResult.OK)
            {
                // filter data
                SetErrorControl(null);
                foreach (Base c in AllObjects)
                {
                    DataFilterBaseControl c1 = c as DataFilterBaseControl;
                    if (c1 != null && c1.Enabled)
                    {
                        try
                        {
                            if (c1.AutoFilter)
                            {
                                c1.FilterData();
                            }
                            c1.SetReportParameter();
                        }
                        catch
                        {
                            SetErrorControl(c1);
                        }
                    }

                    if (FErrorControl != null)
                    {
                        e.Cancel = true;
                        break;
                    }
                }
            }

            if (FormClosing != null)
            {
                FormClosing(this, e);
            }
            InvokeEvent(FormClosingEvent, e);
        }