Example #1
0
        private static int TableWithVisibleColumns(TableColumnCollection columns)
        {
            int num = columns.Count;

            for (int i = 0; i < columns.Count; i++)
            {
                if (columns[i].Hidden)
                {
                    num--;
                }
            }
            return(num);
        }
Example #2
0
        private static bool SearchFullTable(Table table, SearchContext searchContext)
        {
            bool result = false;
            TableColumnCollection columns = table.Columns;

            if (Table.TableWithVisibleColumns(columns) == 0)
            {
                return(result);
            }
            result = Table.SearchTableRows(table.TableHeader, columns, searchContext);
            if (!table.NoRows && !result)
            {
                TableGroupCollection tableGroups = table.TableGroups;
                if (tableGroups != null)
                {
                    int num = 0;
                    while (!result && num < tableGroups.Count)
                    {
                        result = Table.SearchFullTableGroup(tableGroups[num], columns, searchContext);
                        num++;
                    }
                }
                else
                {
                    TableRowsCollection detailRows = table.DetailRows;
                    if (detailRows != null)
                    {
                        int num2 = 0;
                        while (!result && num2 < detailRows.Count)
                        {
                            result = Table.SearchTableRows(detailRows[num2], columns, searchContext);
                            num2++;
                        }
                    }
                }
            }
            if (!result)
            {
                result = Table.SearchTableRows(table.TableFooter, columns, searchContext);
            }
            return(result);
        }
Example #3
0
        private static bool SearchRowCells(TableCellCollection rowCells, TableColumnCollection columns, SearchContext searchContext)
        {
            bool flag = false;

            if (rowCells == null)
            {
                return(flag);
            }
            int num = 0;

            while (!flag && num < rowCells.Count)
            {
                if (!columns[num].Hidden)
                {
                    flag = rowCells[num].ReportItem.Search(searchContext);
                }
                num++;
            }
            return(flag);
        }
Example #4
0
        private static bool SearchFullTableGroup(TableGroup tableGroup, TableColumnCollection columns, SearchContext searchContext)
        {
            bool result = false;

            if (tableGroup != null && !tableGroup.Hidden)
            {
                result = Table.SearchTableRows(tableGroup.GroupHeader, columns, searchContext);
                if (!result)
                {
                    TableGroupCollection subGroups = tableGroup.SubGroups;
                    if (subGroups != null)
                    {
                        int num = 0;
                        while (!result && num < subGroups.Count)
                        {
                            result = Table.SearchFullTableGroup(subGroups[num], columns, searchContext);
                            num++;
                        }
                    }
                    else
                    {
                        TableRowsCollection detailRows = tableGroup.DetailRows;
                        if (detailRows != null)
                        {
                            int num2 = 0;
                            while (!result && num2 < detailRows.Count)
                            {
                                result = Table.SearchTableRows(detailRows[num2], columns, searchContext);
                                num2++;
                            }
                        }
                    }
                }
                if (!result)
                {
                    result = Table.SearchTableRows(tableGroup.GroupFooter, columns, searchContext);
                }
                return(result);
            }
            return(result);
        }
Example #5
0
        private static bool SearchTableRows(TableRowCollection tableRows, TableColumnCollection columns, SearchContext searchContext)
        {
            bool flag = false;

            if (tableRows == null)
            {
                return(flag);
            }
            TableRow tableRow = null;
            int      num      = 0;

            while (!flag && num < tableRows.Count)
            {
                tableRow = tableRows[num];
                if (!tableRow.Hidden)
                {
                    flag = Table.SearchRowCells(tableRow.TableCellCollection, columns, searchContext);
                }
                num++;
            }
            return(flag);
        }
Example #6
0
        private static bool SearchPartialTableGroup(TableGroup group, TableColumnCollection columns, SearchContext searchContext)
        {
            TableHeaderFooterRows tableHeaderFooterRows = null;
            bool          flag           = false;
            SearchContext searchContext2 = new SearchContext(searchContext);

            tableHeaderFooterRows = group.GroupHeader;
            if (tableHeaderFooterRows != null)
            {
                if (searchContext.SearchPage == searchContext.ItemStartPage || tableHeaderFooterRows.RepeatOnNewPage)
                {
                    flag = Table.SearchTableRows(tableHeaderFooterRows, columns, searchContext2);
                }
                if (flag)
                {
                    return(true);
                }
            }
            TableGroupCollection subGroups = group.SubGroups;

            if (subGroups != null)
            {
                int num  = 0;
                int num2 = 0;
                int num3 = -1;
                int num4 = -1;
                group.GetSubGroupsOnPage(searchContext.SearchPage, out num, out num2);
                if (num >= 0)
                {
                    SearchContext searchContext3 = new SearchContext(searchContext);
                    group.IsGroupOnThisPage(num, searchContext.SearchPage, out num3, out num4);
                    TableGroup tableGroup = subGroups[num];
                    if (num3 != num4)
                    {
                        searchContext3.ItemStartPage = num3;
                        searchContext3.ItemEndPage   = num4;
                        flag = Table.SearchPartialTableGroup(tableGroup, columns, searchContext3);
                    }
                    else
                    {
                        flag = Table.SearchFullTableGroup(tableGroup, columns, searchContext2);
                    }
                    num++;
                    while (!flag && num < num2)
                    {
                        tableGroup = subGroups[num];
                        flag       = Table.SearchFullTableGroup(tableGroup, columns, searchContext2);
                        num++;
                    }
                    if (!flag && num == num2)
                    {
                        tableGroup = subGroups[num];
                        group.IsGroupOnThisPage(num, searchContext.SearchPage, out num3, out num4);
                        if (num3 != num4)
                        {
                            searchContext3.ItemStartPage = num3;
                            searchContext3.ItemEndPage   = num4;
                            flag = Table.SearchPartialTableGroup(tableGroup, columns, searchContext3);
                        }
                        else
                        {
                            flag = Table.SearchFullTableGroup(tableGroup, columns, searchContext2);
                        }
                    }
                }
            }
            else
            {
                TableRowsCollection detailRows = group.DetailRows;
                if (detailRows != null)
                {
                    int num5 = 0;
                    int num6 = 0;
                    int num7 = 0;
                    group.GetDetailsOnThisPage(searchContext.SearchPage - searchContext.ItemStartPage, out num5, out num6);
                    if (num5 >= 0)
                    {
                        num7 = num5 + num6 - 1;
                        while (!flag && num5 <= num7)
                        {
                            flag = Table.SearchTableRows(detailRows[num5], columns, searchContext2);
                            num5++;
                        }
                    }
                }
            }
            if (flag)
            {
                return(true);
            }
            tableHeaderFooterRows = group.GroupFooter;
            if (tableHeaderFooterRows != null && (tableHeaderFooterRows.RepeatOnNewPage || searchContext.ItemEndPage == searchContext.SearchPage))
            {
                flag = Table.SearchTableRows(tableHeaderFooterRows, columns, searchContext2);
            }
            return(flag);
        }