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_BindRowAdded(object sender, GanttRowEventArgs args) { var info = args.Item as ToolGantt.GanttInfo; var colHeader = _gantt.ColumnHeader; if (_totalLoadTImeFrBarDic.ContainsKey(info.EqpID) == false) { _totalLoadTImeFrBarDic.Add(info.EqpID, _rowsumLoadTimeFrBar); } if (this.IsOnlyToolMode) { string sLoadRate = string.Empty; double loadRate = 0; sLoadRate = Math.Round(loadRate, 1).ToString() + "%"; //XtraSheetHelper.SetTotCellValue(colHeader.GetCellInfo(args.RowIndex, ColName.MaskChangeCnt), _rowsumJobChg); } XtraSheetHelper.SetTotCellValue(colHeader.GetCellInfo(args.RowIndex, ColName.RunQtySum), _rowsumto); _subTotalTI += _rowsumti; _subTotalTO += _rowsumto; _totalTO += _rowsumto; _subJobChg += _rowsumJobChg; _totalJobChg += _rowsumJobChg; }
void GanttView_BindRowAdded(object sender, GanttRowEventArgs args) { this.subTotalTIQty = rowTIQty; this.totalTIQty += rowTIQty; var colHeader = this.gantt.ColumnHeader; XtraSheetHelper.SetTotCellValue(colHeader.GetCellInfo(typeStartRowIndex, Constants.COLUMN_QTY), this.subTotalTIQty); XtraSheetHelper.SetTotCellValue(colHeader.GetCellInfo(lineIDStartRowIndex, Constants.COLUMN_TOTAL), this.totalTIQty); }
private void SetRowHeaderValue(int rowIndex, string shopID, string eqpId, string stepSeq, string toolID) { if (IsOnlyToolMode) { string curKey = toolID; var colHeader = _gantt.ColumnHeader; if (_isFirst) { _preShopID = shopID; _preToolID = toolID; _preEqpID = eqpId; _preRowKey = curKey; _startSameEqpRowIdx = rowIndex; _startSameRowKeyIdx = rowIndex; _isFirst = false; } if (_isFirst == false && toolID.Equals(_preToolID) == false) { MergeRows(_startSameEqpRowIdx, rowIndex - 1); _startSameEqpRowIdx = rowIndex; } if (_isFirst == false && shopID.Equals(_preShopID) == false) { MergeRows(_startSameEqpRowIdx, rowIndex - 1); _startSameEqpRowIdx = rowIndex; } if (_isFirst == false && toolID.Equals(_preToolID) == false) { if (_startSameEqpRowIdx > 1) { XtraSheetHelper.SetTotCellValue(colHeader.GetCellInfo(_startSameEqpRowIdx - 1, ColName.TotalRun), _subTotalTO); if (this.IsOnlyToolMode == false) { //XtraSheetHelper.SetTotCellValue(colHeader.GetCellInfo(_startSameEqpRowIdx - 1, ColName.MaskChangeCnt), _subJobChg); } } _preShopID = shopID; _preToolID = toolID; _preEqpID = eqpId; _startSameEqpRowIdx = rowIndex; _subTotalTI = 0; _subTotalTO = 0; _subJobChg = 0; } if (_isFirst == false && curKey.Equals(_preRowKey) == false) { MergeRows(_startSameRowKeyIdx, rowIndex - 1); Color tmp = _preColor; _preColor = _currColor; _currColor = tmp; _preRowKey = curKey; //_startSameRowKeyIdx = rowIndex; } PaintRowKeyedCell(rowIndex, _currColor); XtraSheetHelper.SetCellText(colHeader.GetCellInfo(rowIndex, ColName.ShopID), shopID); XtraSheetHelper.SetCellText(colHeader.GetCellInfo(rowIndex, ColName.MaskID), toolID); if (this.IsOnlyToolMode == false) { XtraSheetHelper.SetCellText(colHeader.GetCellInfo(rowIndex, ColName.EqpId), eqpId); } _gantt.Worksheet[rowIndex, colHeader.TryGetColumnIndex(ColName.ShopID)].SetCellText(shopID); colHeader.GetCellInfo(rowIndex, ColName.ShopID).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center; colHeader.GetCellInfo(rowIndex, ColName.ShopID).Alignment.Vertical = SpreadsheetVerticalAlignment.Center; _gantt.Worksheet[rowIndex, colHeader.TryGetColumnIndex(ColName.MaskID)].SetCellText(toolID); colHeader.GetCellInfo(rowIndex, ColName.MaskID).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center; colHeader.GetCellInfo(rowIndex, ColName.MaskID).Alignment.Vertical = SpreadsheetVerticalAlignment.Center; if (this.IsOnlyToolMode == false) { colHeader.GetCellInfo(rowIndex, ColName.EqpId).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center; colHeader.GetCellInfo(rowIndex, ColName.EqpId).Alignment.Vertical = SpreadsheetVerticalAlignment.Center; } } else { string curKey = eqpId; string curToolKey = toolID; var colHeader = _gantt.ColumnHeader; if (_isFirst) { _preToolID = toolID; _preEqpID = eqpId; _preRowKey = curKey; _startSameEqpRowIdx = rowIndex; _startSameRowKeyIdx = rowIndex; _isFirst = false; } if (SelectViewMode == ToolGantt.ViewMode.EQP) { if (_isFirst == false && (toolID.Equals(_preToolID) == false || eqpId.Equals(_preEqpID) == false)) { MergeRows(_startSameEqpRowIdx, rowIndex - 1); _preToolID = toolID; _startSameEqpRowIdx = rowIndex; } if (_isFirst == false && eqpId.Equals(_preEqpID) == false) { if (_startSameEqpRowIdx > 1) { string sLoadRate = string.Empty; XtraSheetHelper.SetTotCellValue(colHeader.GetCellInfo(_startSameEqpRowIdx - 1, ColName.TotalRun), _subTotalTO); } _preToolID = toolID; _preEqpID = eqpId; _startSameEqpRowIdx = rowIndex; _subTotalTI = 0; _subTotalTO = 0; _subJobChg = 0; } if (_isFirst == false && curKey.Equals(_preRowKey) == false) { MergeRows(_startSameRowKeyIdx, rowIndex - 1); Color tmp = _preColor; _preColor = _currColor; _currColor = tmp; _preRowKey = curKey; _startSameRowKeyIdx = rowIndex; } PaintRowKeyedCell(rowIndex, _currColor); XtraSheetHelper.SetCellText(colHeader.GetCellInfo(rowIndex, ColName.MaskID), toolID); _gantt.Worksheet[rowIndex, colHeader.TryGetColumnIndex(ColName.MaskID)].SetCellText(toolID); XtraSheetHelper.SetCellText(colHeader.GetCellInfo(rowIndex, ColName.EqpId), eqpId); colHeader.GetCellInfo(rowIndex, ColName.EqpId).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center; colHeader.GetCellInfo(rowIndex, ColName.EqpId).Alignment.Vertical = SpreadsheetVerticalAlignment.Center; colHeader.GetCellInfo(rowIndex, ColName.MaskID).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center; colHeader.GetCellInfo(rowIndex, ColName.MaskID).Alignment.Vertical = SpreadsheetVerticalAlignment.Center; } if (SelectViewMode == ToolGantt.ViewMode.MASK) { if (_isFirst == false && (toolID.Equals(_preToolID) == false || eqpId.Equals(_preEqpID) == false)) { MergeRows(_startSameEqpRowIdx, rowIndex - 1, 1); _preToolID = toolID; _preEqpID = eqpId; _startSameEqpRowIdx = rowIndex; } if (_isFirst == false && eqpId.Equals(_preToolID) == false) { if (_startSameEqpRowIdx > 1) { string sLoadRate = string.Empty; XtraSheetHelper.SetTotCellValue(colHeader.GetCellInfo(_startSameEqpRowIdx - 1, ColName.TotalRun), _subTotalTO); } _preToolID = toolID; _preEqpID = eqpId; _startSameEqpRowIdx = rowIndex; _subTotalTI = 0; _subTotalTO = 0; _subJobChg = 0; } if (_isFirst == false && curKey.Equals(_preRowKey) == false) { MergeRows(_startSameRowKeyIdx, rowIndex - 1, 1); Color tmp = _preColor; _preColor = _currColor; _currColor = tmp; _preRowKey = curKey; _startSameRowKeyIdx = rowIndex; } PaintRowKeyedCell(rowIndex, _currColor); XtraSheetHelper.SetCellText(colHeader.GetCellInfo(rowIndex, ColName.MaskID), toolID); _gantt.Worksheet[rowIndex, colHeader.TryGetColumnIndex(ColName.MaskID)].SetCellText(toolID); XtraSheetHelper.SetCellText(colHeader.GetCellInfo(rowIndex, ColName.EqpId), eqpId); colHeader.GetCellInfo(rowIndex, ColName.EqpId).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center; colHeader.GetCellInfo(rowIndex, ColName.EqpId).Alignment.Vertical = SpreadsheetVerticalAlignment.Center; colHeader.GetCellInfo(rowIndex, ColName.MaskID).Alignment.Horizontal = SpreadsheetHorizontalAlignment.Center; colHeader.GetCellInfo(rowIndex, ColName.MaskID).Alignment.Vertical = SpreadsheetVerticalAlignment.Center; } } }