All you have to do is write a text file that is TAB delimited.
Just loop through the rows and for each one add a line to a string.
Between each column value enter a TAB character.
Make the filename have an extension of .xls
You'll have to do the graphs after the file is created.
Otherwise, you've gotta have Excel (or some 'Excelable' component) accessible to .NET on the server.
I didn't test this but it should get you close.
Code:
oFile = new StreamWriter(Server.MapPath("MyFilePath") + "/MyNewFile.xls");
oFile.WriteLine("First Name Last Name Address City State");
for(int i=0;i<DataGrid1.Items.Count;i++)
{
//Retrieve the string for each column
//Add a tab to the end of each line
for(int x=0;x<DataGrid1.Columns.Count;x++)
{
sLine = DataGrid1.Items[i].Cells[x].ToString(); + " " +
}
oFile.WriteLine(sLine);
}
oFile.Close();