Ejemplo n.º 1
0
        public override int GetRowsCount(RenderContext context)
        {
            if (context.GroupValues != null)
            {
                if (ColumnAggregateRowsCountHandler != null)
                {
                    return(ColumnAggregateRowsCountHandler(context.Journal, context.GroupValues));
                }
                return(base.GetRowsCount(context));
            }

            context.LoadData(BaseJournalCrossTable);

            if (ColumnRowsCountHandler != null)
            {
                return(ColumnRowsCountHandler(context.GetDataRow <TDataRow>()));
            }

            int count;

            if (ExecuteGetRowsCount(context, out count))
            {
                return(count);
            }

            return(1);
        }
Ejemplo n.º 2
0
        public override string GetName(RenderContext context)
        {
            if (context.GroupValues != null)
            {
                if (ColumnAggregateNameHandler != null)
                {
                    return(ColumnAggregateNameHandler(context.CrossColumnId, context.GroupValues));
                }
                return(GetGroupName(context));
            }
            var row = context.GetDataRow <TDataRow>();

            if (row == null)
            {
                return(string.Empty);
            }
            if (GetNameHandler != null && !_executeGetName)
            {
                _executeGetName = true;
                try
                {
                    return(GetNameHandler(context));
                }
                finally
                {
                    _executeGetName = false;
                }
            }
            if (ColumnNameHandler != null)
            {
                return(ColumnNameHandler(row));
            }
            return(base.GetName(context));
        }
Ejemplo n.º 3
0
 public override bool ShowAsTemplate(RenderContext context)
 {
     if (context.AggregateDataRow == null)
     {
         context.AggregateDataRow = GetAggregateRow(context, context.GetDataRow <TRow>());
     }
     return(base.ShowAsTemplate(context));
 }
Ejemplo n.º 4
0
 public override string GetName(object row, object item, string crossColumnId, object[] groupValues)
 {
     if (row == null && _getNameContext != null)
     {
         row = _getNameContext.GetDataRow <TRow>();
     }
     return(base.GetName(GetAggregateRow(_getNameContext, (TRow)row), item, crossColumnId, groupValues));
 }
        public override int GetRowsCount(RenderContext context)
        {
            var row = context.GetDataRow <TRow>();

            if (CrossTable == null && row != null && !IsCrossColumn && context.GroupValues == null)
            {
                return(BaseCrossTable.GetGroupRowsCount(context));
            }
            return(base.GetRowsCount(context));
        }
        public override object GetDataItem(RenderContext context)
        {
            var row = context.GetDataRow <TRow>();

            if (CurrentValues.ContainsKey(row))
            {
                var rows = CurrentValues[row];
                if (rows.Count > context.RowIndex)
                {
                    return(rows[context.RowIndex]);
                }
            }
            return(null);
        }
Ejemplo n.º 7
0
 public override string GetName(RenderContext context)
 {
     _getNameContext = context;
     try
     {
         if (context.AggregateDataRow == null)
         {
             context.AggregateDataRow = GetAggregateRow(context, context.GetDataRow <TRow>());
         }
         return(base.GetName(context));
     }
     finally
     {
         _getNameContext = null;
     }
 }
Ejemplo n.º 8
0
 public override object GetValue(RenderContext context, bool allowGetGroupValue)
 {
     _getValueContext = context;
     try
     {
         if (context.AggregateDataRow == null)
         {
             context.AggregateDataRow = GetAggregateRow(context, context.GetDataRow <TRow>());
         }
         return(base.GetValue(context, allowGetGroupValue));
     }
     finally
     {
         _getValueContext = null;
     }
 }
Ejemplo n.º 9
0
        public override object GetValue(RenderContext context)
        {
            if (context.GroupValues != null)
            {
                if (ColumnAggregateValueHandler != null)
                {
                    return(ColumnAggregateValueHandler(context.CrossColumnId, context.GroupValues));
                }
                return(GetGroupValue(context));
            }

            context.LoadData(BaseJournalCrossTable);

            var row = context.GetDataRow <TDataRow>();

            if (row == null)
            {
                return(null);
            }
            if (GetValueHandler != null && !_executeGetValue)
            {
                _executeGetValue = true;
                try
                {
                    return(GetValueHandler(context));
                }
                finally
                {
                    _executeGetValue = false;
                }
            }
            if (ColumnValueHandler != null)
            {
                return(ColumnValueHandler(row));
            }
            return(base.GetValue(context));
        }
Ejemplo n.º 10
0
        public override int GetRowsCount(RenderContext context)
        {
            if (context.GroupValues != null)
            {
                return(base.GetRowsCount(context));
            }

            int count;

            if (ExecuteGetRowsCount(context, out count))
            {
                return(count);
            }

            var row = context.GetDataRow <TRow>();

            if (CrossTable != null)
            {
                context.LoadData(CrossTable);
                if (CrossTable.RowValues.ContainsKey(row))
                {
                    return(1);
                }
                if (CrossTable.CurrentValuesRows != null && CrossTable.CurrentValuesRows.ContainsKey(row))
                {
                    return(CrossTable.CurrentValuesRows[row].Count);
                }
                return(CrossTable.RowGroupedValues[row].Count);
            }

            if (IsCrossColumn)
            {
                return(BaseCrossTable.GetRowsCount(context));
            }
            return(BaseCrossTable.GetRowsCount(context));
        }
Ejemplo n.º 11
0
 public override string GetRowNumber(RenderContext context)
 {
     if (RowNumberHandler != null)
     {
         return(RowNumberHandler((BaseJournalRow <TRow>)context.JournalRow, context.Journal, context.GetDataRow <TRow>()));
     }
     return(base.GetRowNumber(context));
 }