private void AddColumn <TEntity>(VerticalReportSchemaBuilder <TEntity> builder, PropertyInfo property, ReportVariableAttribute attribute, Attribute[] globalAttributes)
        {
            IReportCellsProvider <TEntity> instance = this.CreateCellsProvider <TEntity>(property, attribute);

            builder.AddColumn(instance);
            builder.AddAlias(property.Name);

            this.ApplyAttributes(builder, property, globalAttributes);
        }
Beispiel #2
0
        protected ReportSchemaBuilder <TSourceEntity> InsertCellsProvider(int index, IReportCellsProvider <TSourceEntity> provider)
        {
            this.currentProvider = new ConfiguredCellsProvider(provider);

            this.CellsProviders.Insert(index, this.currentProvider);
            this.NamedProviders[this.currentProvider.Provider.Title] = this.currentProvider;

            return(this);
        }
Beispiel #3
0
 public ReportSchemaCellsProvider(
     IReportCellsProvider <TSourceEntity> provider,
     ReportCellProperty[] cellProperties,
     ReportCellProperty[] headerProperties,
     IReportCellProcessor <TSourceEntity>[] cellProcessors,
     IReportCellProcessor <TSourceEntity>[] headerProcessors)
 {
     this.provider         = provider;
     this.cellProperties   = cellProperties;
     this.headerProperties = headerProperties;
     this.cellProcessors   = cellProcessors;
     this.headerProcessors = headerProcessors;
 }
        private IReportCellsProvider <TEntity> CreateCellsProvider <TEntity>(PropertyInfo property, ReportVariableAttribute attribute)
        {
            ParameterExpression parameter        = Expression.Parameter(typeof(TEntity), "x");
            MemberExpression    memberExpression = Expression.Property(parameter, typeof(TEntity), property.Name);
            LambdaExpression    lambdaExpression = Expression.Lambda(memberExpression, parameter);

            IReportCellsProvider <TEntity> instance = (IReportCellsProvider <TEntity>)Activator.CreateInstance(
                typeof(ComputedValueReportCellsProvider <,>)
                .MakeGenericType(typeof(TEntity), property.PropertyType),
                attribute.Title,
                lambdaExpression.Compile());

            return(instance);
        }
Beispiel #5
0
 public ConfiguredCellsProvider(IReportCellsProvider <TSourceEntity> provider)
 {
     this.Provider = provider;
 }
Beispiel #6
0
 public IVerticalReportSchemaBuilder <TSourceEntity> AddColumn(IReportCellsProvider <TSourceEntity> provider)
 {
     return(this.InsertColumn(this.CellsProviders.Count, provider));
 }
Beispiel #7
0
 public IVerticalReportSchemaBuilder <TSourceEntity> InsertColumnBefore(string title, IReportCellsProvider <TSourceEntity> provider)
 {
     return(this.InsertColumn(this.GetCellsProviderIndex(title), provider));
 }
Beispiel #8
0
        public IVerticalReportSchemaBuilder <TSourceEntity> InsertColumn(int index, IReportCellsProvider <TSourceEntity> provider)
        {
            this.InsertCellsProvider(index, provider);

            return(this);
        }
Beispiel #9
0
        public IHorizontalReportSchemaBuilder <TSourceEntity> InsertHeaderRow(int rowIndex, IReportCellsProvider <TSourceEntity> provider)
        {
            ConfiguredCellsProvider configuredCellsProvider = new ConfiguredCellsProvider(provider);

            this.headerProviders.Insert(rowIndex, configuredCellsProvider);

            this.SelectProvider(configuredCellsProvider);

            return(this);
        }
Beispiel #10
0
 public IHorizontalReportSchemaBuilder <TSourceEntity> AddHeaderRow(IReportCellsProvider <TSourceEntity> provider)
 {
     return(this.InsertHeaderRow(this.headerProviders.Count, provider));
 }
Beispiel #11
0
 public IHorizontalReportSchemaBuilder <TSourceEntity> InsertRowBefore(string title, IReportCellsProvider <TSourceEntity> provider)
 {
     return(this.InsertRow(this.GetCellsProviderIndex(title), provider));
 }
Beispiel #12
0
        public IHorizontalReportSchemaBuilder <TSourceEntity> InsertRow(int index, IReportCellsProvider <TSourceEntity> provider)
        {
            this.InsertCellsProvider(index, provider);

            return(this);
        }