GetCellPos() public method

gets the rowIndex and colIndex of the chart according to the name of the cell
public GetCellPos ( string cellName, Table tableData ) : CellPos
cellName string
tableData AODL.Document.Content.Tables.Table
return CellPos
Esempio n. 1
0
		public void InsertChartAt(string cellName,Chart chart)
		{
			string endCell= chart.EndCellAddress ;
			
			if (endCell==null)
			{
				int CurRowIndex= chart.GetCellPos (cellName,this).rowIndex ;
				int CurColIndex= chart.GetCellPos (cellName,this).columnIndex ;
				int EndRowIndex = CurRowIndex +15;
				int EndColIndex = CurColIndex +5;

				string EndCellRow  =EndRowIndex.ToString ();
				string EndCellCol  = null;

				if (EndColIndex<=26)
				{
					char  col = (char)(EndColIndex+'A'-1);
					EndCellCol=col.ToString ();
				}

				else if (CurColIndex>26&&CurColIndex<=260)
				{
					int FirstCha = CurColIndex/26;
					char FirstCharacter = (char)(FirstCha+'A'-1);
					int SecondCha =CurColIndex%2 ;
					char SecondChatacter = (char)(SecondCha+'A'-1);
					EndCellCol=FirstCharacter.ToString ()+SecondChatacter.ToString ();
				}

				endCell = this.TableName +"."+EndCellCol+EndCellRow;
				chart.EndCellAddress =endCell;
			}

			Cell   cell = (chart.GetCellPos (cellName,this)).cell ;
			cell.Content .Add (chart.Frame );
		}