Example #1
0
        public ReportDataEntity GetDataEntity(bool hasBlobData = true)
        {
            ReportDataEntity entity = new ReportDataEntity {
                ReportProperty = this.ReportProperty
            };
            int num = 0;

            foreach (SheetDataModel model in from s in this.SheetModels
                     orderby s.Index
                     select s)
            {
                PivotGridDataModel pivotGridModel = model.GetPivotGridModel();
                if (pivotGridModel.Columns.Count != 0)
                {
                    SheetDataEntity sheet = new SheetDataEntity {
                        SheetId           = model.SheetId,
                        Name              = model.SheetName,
                        Index             = num++,
                        DimensionGroupKey = model.DimensionGroupKey
                    };
                    if (hasBlobData)
                    {
                        sheet.Data = model.GetDataBlob();
                    }
                    sheet.SchemeId      = model.SchemeId;
                    sheet.CalendarId    = model.CalendarId;
                    sheet.PivotGridData = pivotGridModel;
                    entity.Sheets.Add(sheet);
                }
            }
            return(entity);
        }
Example #2
0
 public ReportDataModel(ReportDataEntity entity)
 {
     this._sheetModels   = new SheetDataModelCollection();
     this.ReportProperty = entity.ReportProperty;
     this._sheetModels.CollectionChanged += new NotifyCollectionChangedEventHandler(this.SheetModels_CollectionChanged);
     foreach (SheetDataEntity entity2 in entity.Sheets)
     {
         SheetDataModel sheeModel = new SheetDataModel(entity2);
         this.AddSheet(sheeModel);
     }
 }