Exemple #1
0
        private static void Filter(ref VirtualDataTable aTable, string RowFilter, ref bool TableNeedsDispose, string aName)
        {
            RowFilter = RowFilter.Trim();
            if (string.IsNullOrEmpty(RowFilter))
            {
                if (aTable.TableName != aName)
                {
                    VirtualDataTable nTable = aTable.FilterData(aName, null);
                    if (aTable != null && TableNeedsDispose)
                    {
                        aTable.Dispose();
                    }
                    aTable            = nTable;
                    TableNeedsDispose = true;
                }
                return;
            }

            int fPos = RowFilter.IndexOf(ReportTag.StrOpenParen);

            if (fPos > 2)
            {
                if (String.Equals(RowFilter.Substring(0, fPos).Trim(), ReportTag.ConfigTag(ConfigTagEnum.Distinct), StringComparison.InvariantCultureIgnoreCase))
                {
                    if (RowFilter[RowFilter.Length - 1] != ReportTag.StrCloseParen)
                    {
                        FlxMessages.ThrowException(FlxErr.ErrInvalidFilterParen, RowFilter);
                    }

                    VirtualDataTable bTable = aTable.GetDistinct(aName, GetColumnsForDistinct(aTable, RowFilter.Substring(fPos + 1, RowFilter.Length - fPos - 2)));
                    if (aTable != null && TableNeedsDispose)
                    {
                        aTable.Dispose();
                    }
                    aTable = bTable;

                    TableNeedsDispose = true;
                    return;
                }
            }

            VirtualDataTable cTable = aTable.FilterData(aName, RowFilter);

            if (aTable != null && TableNeedsDispose)
            {
                aTable.Dispose();
            }
            aTable            = cTable;
            TableNeedsDispose = true;
        }
Exemple #2
0
 public override VirtualDataTable GetDistinct(string newDataName, int[] filterFields)
 {
     return(new TTopDataTable(newDataName, this, ActualData.GetDistinct(newDataName, filterFields), TopCount));
 }