///// <summary> ///// Get Data from a collection of cells ///// </summary> ///// <param name="worksheet"></param> ///// <param name="columStart"></param> ///// <param name="columEnd"></param> ///// <param name="rowStart"></param> ///// <param name="rowEnd"></param> ///// <returns></returns> //public static List<CellEntry> GetCellDataCollection(this GS2U_Worksheet worksheet, string columStart, string columEnd, int rowStart, int rowEnd) //{ // CellQuery cellQuery = new CellQuery(worksheet.CellFeedLink); // cellQuery.MinimumRow = (uint)rowStart; // cellQuery.MaximumRow = (uint)rowEnd; // cellQuery.MinimumColumn = (uint)Util.GetIndexInAlphabet(columStart); // cellQuery.MaximumColumn = (uint)Util.GetIndexInAlphabet(columEnd); // CellFeed cellFeed = SpreadSheetManager.service.Query(cellQuery) as CellFeed; // List<CellEntry> entries = new List<CellEntry>(); // for (int i = 0; i < cellFeed.Entries.Count; i++) // { // entries.Add((CellEntry)cellFeed.Entries[i]); // } // return entries; //} //public static void ModifyCellData(this CellEntry cell, string newData) //{ // cell.InputValue = newData; // cell.Update(); //} public static void ModifyCellData(this GS2U_Worksheet worksheet, string colum, int row, string newData) { CellEntry cell = worksheet.GetCellEntry(colum, row); cell.InputValue = newData; cell.Update(); }
/// <summary> /// Gets the data from an exact cell reference /// </summary> /// <param name="worksheet"></param> /// <param name="column"></param> /// <param name="row"></param> /// <returns></returns> public static CellData GetCellData(this GS2U_Worksheet worksheet, string column, int row) { int colInt = GoogleSheetsToUnityUtilities.GetIndexInAlphabet(column); CellEntry entry = worksheet.GetCellEntry(colInt, row); List <string> rows = worksheet.GetRowTitles(); List <string> cols = worksheet.GetColumnTitles(); CellData cellData = new CellData(entry.InputValue, rows[row - 1], cols[colInt - 1]); return(cellData); }