Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

Learning is a never ending thing and just one life is not enough to learn all the things you want to learn. The ocean of knowledge is very, very deep. This blog has been created for the same objective. I write on things which I come across in my daily life and feel to share it with the people across the world. The blog publish articles on SQL Server, SSIS 2005, SSIS 2008 alongwith other useful stuff which are good to know for the professional life.
Browse by Tags · View All
Google SpreadSheet API 12
YouTube API with .NET 7
PEGA Tutorials 6
PRPC Tutorials 6
Google BigQuery 6
Google Analytics API in .NET 6
Google Cloud Services 5
Core Reporting API with C# 4
Good Data API with Picasa 4
Ms-Excel function 4

Archive · View All
June 2012 17
October 2012 12
May 2012 12
August 2012 11
March 2013 10
July 2012 10
December 2011 9
January 2012 7
September 2012 6
February 2012 6

SinghVikash Blog

SpreadSheet API: How to add blank rows and columns to Google Spreadsheet?

Jun 20 2012 12:00AM by Vikash Kumar Singh   

This post is next in series of our learning towards Google Spreadsheet API. In this post we will lean how we can add blank rows and columns from our .NET interface.

To continue our example we had uploaded EmpDetails Spreadsheet in our very first post to Google Docs. This spreadsheet has four columns and five rows into it. We will add some blank rows and columns in this spreadsheet using our .NET interface.

To start with, I have following controls on my .NET form. There are two buttons and one listview control. The button "Pull Spreadsheet List" will read all the available Spreadsheets available in my Google Doc account and add it into Listview1 control. For button "Add Blank rows/Columns" the concept is after clicking on this button the .NET code logic will interact with the selected spreadsheet and add blank rows and columns into it.

using Google.GData;
using Google.GData.Client;
using Google.GData.Extensions;
using Google.GData.Spreadsheets;

We need a form level variable so we declared it at form level.

public partial class Form1 : Form
{
string spreadsheetName;

The .NET code logic on the "Pull Spreadsheet List" button is following. The code will pull the spreadsheet list from Google Doc.

private void button1_Click(object sender, EventArgs e)
{
listView1.Columns.Add("SpreadSheet Name");
listView1.Columns.Add("Summary");
listView1.Columns.Add("Published Date");
listView1.FullRowSelect = true;

SpreadsheetsService GoogleExcelService;
GoogleExcelService = new SpreadsheetsService("Spreadsheet-Vikash-Test-App");
GoogleExcelService.setUserCredentials("gmailuserid", "Gmailpassword");

SpreadsheetQuery query = new SpreadsheetQuery();
SpreadsheetFeed myFeed = GoogleExcelService.Query(query);

foreach (SpreadsheetEntry mySpread in myFeed.Entries)
{
listView1.Items.Add(new ListViewItem(new string[] { mySpread.Title.Text, mySpread.Summary.Text, mySpread.Updated.ToShortDateString() }));

}

}

I have following .NET code logic on Listview1 SelectedIndexChanged event to store the Spreadsheet name the user has selected.

private void listView1_SelectedIndexChanged(object sender, EventArgs e)
{
spreadsheetName = "";
ListView.SelectedListViewItemCollection SpreadsheetList = listView1.SelectedItems;

foreach (ListViewItem item in SpreadsheetList)
{
spreadsheetName = item.SubItems[0].Text.ToString();

}
}

The code logic for button "Add Blank rows/Columns" is following. We are adding 10 rows and 8 columns into the spreadsheet.

private void button2_Click(object sender, EventArgs e)
{
if (spreadsheetName.Length > 0)
{
SpreadsheetsService GoogleExcelService;
GoogleExcelService = new SpreadsheetsService("Spreadsheet-Vikash-Test-App");
GoogleExcelService.setUserCredentials("gmailuserid", "Gmailpassword");

SpreadsheetQuery query = new SpreadsheetQuery();
SpreadsheetFeed myFeed = GoogleExcelService.Query(query);

foreach (SpreadsheetEntry mySpread in myFeed.Entries)
{
if (mySpread.Title.Text == spreadsheetName)
{
WorksheetFeed wfeed = mySpread.Worksheets;
foreach (WorksheetEntry wsheet in wfeed.Entries)
{
//Add Blank rows and columns
wsheet.Rows = 10;
wsheet.Cols = 8;
wsheet.Update();

}
}

}
System.Windows.Forms.MessageBox.Show("Rows and Columns Added Successfully");

}
}

After setting up the code, I connected to internet and run the form. The first thing I did was to click on Pull Spreadsheet list. The code logic on this button pulled all the spreadsheet available to my Google Doc. The next thing I did was to select EmpDetails Spreadsheet and click on button Add Blank rows/Columns. The code logic runs successfully and pop-up the message that Blank rows and columns have been added successfully.

I log into my Google Doc account to verify this and blank rows and columns were added successfully.

So our objective to add blank rows and columns was achived.

Thanks for reading till this point.


Republished from Blog by Vikash Kumar Singh [46 clicks].  Read the original version here [1 clicks].

Vikash Kumar Singh
279 · 0% · 152
1
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

Your Comment


Sign Up or Login to post a comment.

"SpreadSheet API: How to add blank rows and columns to Google Spreadsheet?" rated 5 out of 5 by 1 readers
SpreadSheet API: How to add blank rows and columns to Google Spreadsheet? , 5.0 out of 5 based on 1 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]