protected DataQuery GetDataQuery()
        {
            DataQuery dataQuery = ReportProvider.CreateDataQuery();

            dataQuery.Filters.AddRange(filters);

            string reportClass = GetType().FullName;

            BusinessDomain.ReportQueryStates [reportClass] = dataQuery.Clone();

            if (!AllowOperatorsManage())
            {
                // Filter for the current user if the user cannot manage operators
                DataFilter filter = new DataFilter(DataFilterLogic.ExactMatch, UserField)
                {
                    IsValid     = true,
                    Values      = new object [] { BusinessDomain.LoggedUser.Id },
                    ShowColumns = true
                };

                dataQuery.Filters.Add(filter);
            }

            dataQuery.OrderBy = DataField.OperationTimeStamp;

            return(dataQuery);
        }
        private DataQuery GetDataQuery(bool saveSettings)
        {
            DataQuery dataQuery = ReportProvider.CreateDataQuery();

            foreach (FilterBase filter in filters)
            {
                dataQuery.Filters.Add(filter.GetDataFilter());
            }

            if (order != null)
            {
                dataQuery.OrderBy        = order.Selection;
                dataQuery.OrderDirection = order.Direction;
            }

            return(PrepareDataQuery(dataQuery, saveSettings));
        }