void GanttView_BindDone(object sender, EventArgs e) { var colHeader = _gantt.ColumnHeader; _totLoadRate = _totLoadRate / _calCount; double totalLoadRate = _queryPeriod * _totalRowCnt > 0 ? _totalRunHours / (_queryPeriod * (double)_totalRowCnt) * 100 : 0; string sTotalLoadRate = totalLoadRate <= 0 ? string.Empty : Math.Round(totalLoadRate, 1).ToString(); XtraSheetHelper.SetCellFloatValue(colHeader.GetCellInfo(0, ColName.LoadRate), string.Format("{0}\n({1}%)", ColName.LoadRate, sTotalLoadRate)); XtraSheetHelper.SetCellFloatValue(colHeader.GetCellInfo(0, ColName.RunQty), string.Format("{0}\n({1})", ColName.RunQty, _totalTO.ToString("#.#"))); _totalRunHours = 0; _totalRowCnt = 0; colHeader.GetCellInfo(0, ColName.LotID).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center; colHeader.GetCellInfo(0, ColName.LotID).Alignment.Vertical = SpreadsheetVerticalAlignment.Center; colHeader.GetCellInfo(0, ColName.LoadRate).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Left; colHeader.GetCellInfo(0, ColName.RunQty).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Left; //colHeader.GetCellInfo(1, ColName.LoadRate).HorizontalAlignment = GridHorizontalAlignment.Left; MergeRows(_startSameRowKeyIdx, _gantt.LastRowIndex); //MergeRows(_startSameEqpRowIdx, _gantt.LastRowIndex, 1); // Sample에 없음 //grid1.Model.Options.MergeCellsMode = GridMergeCellsMode.OnDemandCalculation | GridMergeCellsMode.MergeRowsInColumn; PaintTotColumnCell(); }
void GanttView_BindRowAdded(object sender, GanttRowEventArgs args) { var info = args.Item as LotGantt.GanttInfo; var colHeader = _gantt.ColumnHeader; _calCount++; XtraSheetHelper.SetCellFloatValue(colHeader.GetCellInfo(args.RowIndex, ColName.LoadRate), 0); //SfGridHelper.SetCellFloatValue(colHeader.GetCellInfo(args.RowIndex, ColName.LoadRate), 0); //SfGridHelper.SetTotCellValue(colHeader.GetCellInfo(args.RowIndex, ColName.TIQtySum), _rowsumti); XtraSheetHelper.SetTotCellValue(colHeader.GetCellInfo(args.RowIndex, ColName.RunQty), _rowsumto); //SfGridHelper.SetTotCellValue(colHeader.GetCellInfo(args.RowIndex, ColName.TOQtySum), _rowsumto); double rowLoadRate = _queryPeriod > 0 ? _rowRunHours / _queryPeriod * 100.0 : 0; string sRowLoadRate = rowLoadRate <= 0 ? string.Empty : Math.Round(rowLoadRate, 1).ToString() + "%"; XtraSheetHelper.SetTotCellValue(colHeader.GetCellInfo(args.RowIndex, ColName.LoadRate), sRowLoadRate); //SfGridHelper.SetTotCellValue(colHeader.GetCellInfo(args.RowIndex, ColName.LoadRate), sRowLoadRate); _totalRowCnt++; colHeader.GetCellInfo(args.RowIndex, ColName.LoadRate).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Left; colHeader.GetCellInfo(args.RowIndex, ColName.LoadRate).Alignment.Vertical = SpreadsheetVerticalAlignment.Center; colHeader.GetCellInfo(args.RowIndex, ColName.RunQty).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Left; colHeader.GetCellInfo(args.RowIndex, ColName.RunQty).Alignment.Vertical = SpreadsheetVerticalAlignment.Center; _subTotalTI += _rowsumti; _subTotalTO += _rowsumto; _totLoadRate += rowLoadRate; _totalTO += _rowsumto; }
void GanttView_BindDone(object sender, EventArgs e) { var colHeader = _gantt.ColumnHeader; // 마지막 Row 값 세팅 if (this.IsOnlyToolMode == false) { XtraSheetHelper.SetCellFloatValue(colHeader.GetCellInfo(_startSameEqpRowIdx, ColName.MaskChangeCnt), _subJobChg); } XtraSheetHelper.SetCellFloatValue(colHeader.GetCellInfo(_startSameEqpRowIdx, ColName.TotalRun), _subTotalTO); #region // mask count //totChgRate = totChgRate / calCount; //loadRateColName = string.Format("{0} \n({1}%)", ColName.LoadRate, totalRateForAct.ToString("#.#")); //var jobChgColName = string.Format("{0} \n({1})", ColName.MaskChangeCnt, _totalJobChg.ToString("#.#")); //XtraSheetHelper.SetCellFloatValue(colHeader.GetCellInfo(0, ColName.MaskChangeCnt), jobChgColName); //colHeader.GetCellInfo(0, ColName.MaskChangeCnt).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center; #endregion string totalToColName = string.Format("{0} \n({1})", "TOTAL", _totalTO.ToString("#.#")); XtraSheetHelper.SetCellFloatValue(colHeader.GetCellInfo(0, ColName.TotalRun), totalToColName); for (int i = 0; i < _gantt.LastRowIndex; i++) { colHeader.GetCellInfo(i, ColName.MaskID).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center; } colHeader.GetCellInfo(0, ColName.MaskID).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center; colHeader.GetCellInfo(0, ColName.RunQtySum).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center; colHeader.GetCellInfo(0, ColName.TotalRun).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center; colHeader.GetCellInfo(0, ColName.MaskID).Alignment.Vertical = SpreadsheetVerticalAlignment.Center; colHeader.GetCellInfo(0, ColName.RunQtySum).Alignment.Vertical = SpreadsheetVerticalAlignment.Center; colHeader.GetCellInfo(0, ColName.TotalRun).Alignment.Vertical = SpreadsheetVerticalAlignment.Center; if (this.IsOnlyToolMode == false) { colHeader.GetCellInfo(0, ColName.EqpId).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center; colHeader.GetCellInfo(0, ColName.EqpId).Alignment.Vertical = SpreadsheetVerticalAlignment.Center; } if (SelectViewMode == ToolGantt.ViewMode.SHOP) { int fromRowIdx = this.IsOnlyToolMode == false ? _startSameEqpRowIdx : _startSameRowKeyIdx; MergeRows(fromRowIdx, _gantt.LastRowIndex); } PaintTotColumnCell(); }