Hello,
 Even if I try to use Cell based feed and add this code: 
  // Fetch the cell feed of the worksheet.

      CellQuery cellQuery = new CellQuery(worksheet.CellFeedLink);
      CellFeed cellFeed = service.Query(cellQuery);

      // Iterate through each cell, updating its value if necessary.
      foreach (CellEntry cell in cellFeed.Entries)
      {
        if (cell.Title.Text == "A1")
        {
          cell.InputValue = "200";
          cell.Update();
        }
        else if (cell.Title.Text == "B1")
        {
          cell.InputValue = "=SUM(A1, 200)";
          cell.Update();
        }
      }

   I get the count of cellFeed.Entries as 0, so the control never enters 
the foreach loop to update (i.e add) cell values at locations A1,B1 and so 
on.
   As mentioned before,I have already added rows and columns into the 
worksheet.
   Again big question how do I add a simple header row values at position 
A1,B1,C1,D1. 



------------------------------------------------------------------------------------------------

On Thursday, October 25, 2012 4:47:10 PM UTC+2, Mandar wrote:
>
> Hi,
>   I still dont get it.Now lets see the scenario:
>   *--> I have created a worksheet and then how am i supposed to add a 
> (SIMPLE) row in it?*
>      Kindly write a sample code for this.
>
>    As per the google version 3 spreadsheet API, (admin/developer) says 
> that the header row (a row at position 1) should be already present in 
> order for a 1st row to be be added (i.e at position 2).
>   And that while inserting this new row (at position 2), the header row 
> should be matched with values.
>
>   Now in all this how do I insert a header row?
>   * As per the 'change contents of cell':   * // Iterate through each 
> cell, updating its value if necessary.
>
>       foreach (CellEntry cell in cellFeed.Entries)
>       {
>         if (cell.Title.Text == "A1")
>         {
>           cell.InputValue = "200";
>           cell.Update();
>         }
>         else if (cell.Title.Text == "B1")
>         {
>           cell.InputValue = "=SUM(A1, 200)";
>           cell.Update();
>         }
>
>       But, I dont have any value,its a empty worksheet. I have also 
> uploaded my (prog. created) spreadsheet in attachments.
>
>  (and what a crap API, i integrated a facebook open graph api in 2 hours 
> for sharing photos,posts with OAuth and here just inserting a row is taking 
> my 1 week!!)
>
>    
>
> On Thursday, October 25, 2012 3:04:32 PM UTC+2, David Bullock wrote:
>>
>> Hi,
>>
>> You don't add a cell.  It's just there, provided the dimensions (max 
>> rows/columns) of the worksheet allow for it.  If you've got a worksheet 
>> that's 10 rows x 10 columns, then you just go right ahead and set the value 
>> of cell R1C1.
>>
>> It says as much in the first paragraph of the link you provided.   
>>
>> I recommend flicking to the 'Protocol' tab of the er, 'example' section. 
>>  When they butchered the existing documentation a while back in the move to 
>> http://developers.google.com/ from http://code.google.com/, they merged 
>> the 'Protocol Guide' and the 'Developer Guide'.  The 
>> really-important-to-understand bits from the Protocol Guide are now 
>> cut'n'pasted under the 'Protocol' tab.
>>
>> Search this group for other posts from me which give links to the *old* 
>> documentation.
>>
>> (And if you find, as I do, that the old documenation was better, please 
>> say so in this forum)
>>
>> cheers,
>> David.
>>
>>
>> On Thu, Oct 25, 2012 at 11:26 PM, Mandar <[email protected]> wrote:
>>
>>> Hello,
>>>   Could you kindly specify how to add a cell, in the documentation its 
>>> only Changing contents of a 
>>> cell<https://developers.google.com/google-apps/spreadsheets/#changing_contents_of_a_cell>
>>>  where 
>>> its if-else for a cell updation when a value match if found.
>>>    How can i add a cell to a worksheet?
>>>
>>> Thankx in advance
>>>
>>> On Thursday, October 25, 2012 1:12:12 PM UTC+2, David Bullock wrote:
>>>
>>>> Hi,
>>>>
>>>> You can use the *cell feed* to set the values in the header row, and 
>>>> then once this is done, use the *list feed* to insert rows.
>>>>
>>>> It hurts less if you realise that any Google-provided library in 
>>>> respect of the Spreadsheet API is just a thin convenience wrapper over the 
>>>> GData 'everything is an Atom article' protocol.  So: be stalwart and learn 
>>>> the protocol; be grateful that you don't have to muck around with XML. 
>>>>  It's a waste of energy to be incredulous that there isn't an api like 
>>>> aSheet.addRow(String[]).
>>>>
>>>> Don't get attached to the ideas behind the GData protocol though (it's 
>>>> easy to, once you get over the initial odd-ness).  The GData stuff is 
>>>> going 
>>>> out the window, to be replaced with something newer and shinier.  Well, 
>>>> that's what we've been told.  We've got no idea if it'll actually address 
>>>> any common use-cases (such as creating a spreadsheet and appending a row!) 
>>>> better than the current offering.  And we don't know when it will arrive.
>>>>
>>>> But they are at least (we hope) working on *something*, which will (we 
>>>> hope) excuse them for basically abandoning this API for half a decade, 
>>>> closing all our bug reports as 'obsolete' without actually *releasing* the 
>>>> facilities which obsolete them, and generally pretending that things are 
>>>> fine, and wondering why the hell are the users complaining anyway.
>>>>
>>>> Welcome to google-spreadsheets-api!  I see you've already been 
>>>> introduced ... !!!
>>>>
>>>> cheers,
>>>> David.
>>>>
>>>>
>>>> On Thu, Oct 25, 2012 at 9:26 PM, Mandar <[email protected]> wrote:
>>>>
>>>>> Hello,
>>>>>   May I know, Do we need to set this first row (header row ) manually 
>>>>> after creating a worksheet , because if we don't then the same error 
>>>>> message is shown. 
>>>>>   Kindly highlight this point here.
>>>>>
>>>>>   
>>>>>
>>>>> On Wednesday, October 24, 2012 8:46:11 PM UTC+2, steve gourley wrote:
>>>>>>
>>>>>> You have to set the first row with values. This is the header row.
>>>>>>
>>>>>>
>>>>>> list rowRow of cells in a worksheet, represented as a key-value 
>>>>>>> pair, where each key is a column name, and each value is the cell 
>>>>>>> value. 
>>>>>>> The first row of a worksheet is always considered the header row when 
>>>>>>> using 
>>>>>>> the API, and therefore is the row that defines the keys represented in 
>>>>>>> each 
>>>>>>> row. 
>>>>>>
>>>>>>
>>>>>> Then you match those up with the LocalName and it works fine as long 
>>>>>> as you don't use numbers.
>>>>>>
>>>>>>  
>>>>>> On Wednesday, October 24, 2012 4:14:26 AM UTC-6, Mandar wrote:
>>>>>>>
>>>>>>> Hello,
>>>>>>>   I am also getting the same error for 4 days now, I am able to 
>>>>>>> delete a row or update it (if i add manually), but adding a row seems 
>>>>>>> to be 
>>>>>>> generating this bad response.
>>>>>>>     
>>>>>>>
>>>>>>>
>>>>>>> Le mercredi 24 octobre 2012 03:56:25 UTC+2, steve gourley a écrit :
>>>>>>>>
>>>>>>>> Hi I have a google.gov account and I am trying to fool with the 
>>>>>>>> spreadsheet api to write to a worksheet. I'm using the clientLogin to 
>>>>>>>> use 
>>>>>>>> my google.gov login from a .net console app that will periodically 
>>>>>>>> write to the spreadsheet.
>>>>>>>>
>>>>>>>> I am successfully able to authenticate, list my spreadsheets, grab 
>>>>>>>> the one I want, grab the worksheet and create some row elements but 
>>>>>>>> inserting fails. The response status code is 400 bad request, the 
>>>>>>>> response 
>>>>>>>> string is We're sorry, a server error occurred. Please wait a bit and 
>>>>>>>> try 
>>>>>>>> reloading your spreadsheet.
>>>>>>>>
>>>>>>>> The exception message is Execution of request failed: 
>>>>>>>> https://spreadsheets.google.**co**m/feeds/list/some<https://spreadsheets.google.com/feeds/list/some>mumbo
>>>>>>>>  jumbo/od6/private/full
>>>>>>>>
>>>>>>>> the url for my spreadsheet in a browser is something like 
>>>>>>>> https://docs.google.com/**a**/utah.gov/spreadsheet/ccc?**key=<https://docs.google.com/a/utah.gov/spreadsheet/ccc?key=>
>>>>>>>>
>>>>>>>> strack trace
>>>>>>>>
>>>>>>>>    at Google.GData.Client.**GDataReque**st.Execute()
>>>>>>>>    at Google.GData.Client.**GDataGAuth**Request.Execute(**Int32 
>>>>>>>> retryCounter)
>>>>>>>>     at Google.GData.Client.**GDataGAuth**Request.Execute()
>>>>>>>>    at Google.GData.Client.Service.**En**trySend(Uri feedUri, 
>>>>>>>> AtomBase baseEntry, GDataRequestType type, AsyncSendData data)
>>>>>>>>    at Google.GData.Client.Service.**In**sert(Uri feedUri, 
>>>>>>>> AtomEntry newEntry, AsyncSendData data)
>>>>>>>>    at Google.GData.Client.Service.**In**sert[TEntry](Uri feedUri, 
>>>>>>>> TEntry entry)
>>>>>>>>    at Google.GData.Client.Service.**Go**ogle.GData.Client.IService.
>>>>>>>> **Ins**ert(AtomFeed feed, AtomEntry entry)
>>>>>>>>     at Google.GData.Client.Service.**In**sert[TEntry](AtomFeed 
>>>>>>>> feed, TEntry entry)
>>>>>>>>    at mapservResponseTimes.Program.**M**ain() in 
>>>>>>>> c:\Projects\Experimental\**mapse**rvResponseTimes\Program.**cs:**line 
>>>>>>>> 58
>>>>>>>>    at System.AppDomain._**nExecuteAsse**mbly(**RuntimeAssembly 
>>>>>>>> assembly, String[] args)
>>>>>>>>    at System.AppDomain.**ExecuteAssemb**ly(String assemblyFile, 
>>>>>>>> Evidence assemblySecurity, String[] args)
>>>>>>>>    at Microsoft.VisualStudio.**Hosting**Process.HostProc.**
>>>>>>>> RunUsersAssem**bly()
>>>>>>>>    at System.Threading.ThreadHelper.****ThreadStart_Context(Object 
>>>>>>>> state)
>>>>>>>>    at System.Threading.**ExecutionCont**ext.RunInternal(**
>>>>>>>> ExecutionConte**xt executionContext, ContextCallback callback, 
>>>>>>>> Object state, Boolean preserveSyncCtx)
>>>>>>>>    at System.Threading.**ExecutionCont**ext.Run(**ExecutionContext 
>>>>>>>> executionContext, ContextCallback callback, Object state, Boolean 
>>>>>>>> preserveSyncCtx)
>>>>>>>>    at System.Threading.**ExecutionCont**ext.Run(**ExecutionContext 
>>>>>>>> executionContext, ContextCallback callback, Object state)
>>>>>>>>    at System.Threading.ThreadHelper.****ThreadStart()
>>>>>>>>
>>>>>>>> What gem of information am I missing to use this with a google for 
>>>>>>>> business account?
>>>>>>>>
>>>>>>>  
>>>>
>>

Reply via email to