예제 #1
0
 public DynamicAreaWriter(DynamicArea entity, BaseWriterContainer parent)
     : base(entity, parent)
 {
     _dynamicObject = new DynamicSource(entity.ProductRule);
     _dynamicObject.SetParam("RowIndex", p => p);
     _dynamicObject.SetParam("RowNum", p => p + 1);
 }
예제 #2
0
        public SheetWriter(ISheet exSheet, Sheet sheet, BaseWriterContainer parent)
            : base(sheet, parent)
        {
            this._exSheet = exSheet;
            this.Entity   = sheet;//(Sheet)sheet.Clone();//防止原始的Xml规则被修改[数据源未Clone]

            if (sheet.IsDynamic)
            {
                _dynamicObject = new DynamicSource(sheet.ProductRule, Entity.ProductRule.GetSource(sheet.SourceName));
                _dynamicObject.SetParam("SheetNum", p => p + 1);
                _dynamicObject.SetParam("SheetIndex", p => p);
                _dynamicObject.DistinctFunc = (dt, index) => { return(parseExpression(sheet.NameRule, dt.Rows[index])); };
            }
        }