Click here to Skip to main content
16,004,901 members
Home / Discussions / C#
   

C#

 
Questiondatagrid problem Pin
steve_rm1-Jan-06 22:36
steve_rm1-Jan-06 22:36 
AnswerRe: datagrid problem Pin
Abdul Raheem Farooq1-Jan-06 23:03
Abdul Raheem Farooq1-Jan-06 23:03 
GeneralRe: datagrid problem Pin
steve_rm2-Jan-06 4:23
steve_rm2-Jan-06 4:23 
QuestionSaving an Excel Workbook in C# Pin
meeram3951-Jan-06 22:11
meeram3951-Jan-06 22:11 
AnswerRe: Saving an Excel Workbook in C# Pin
AB77711-Jan-06 22:22
AB77711-Jan-06 22:22 
GeneralRe: Saving an Excel Workbook in C# Pin
meeram3953-Jan-06 0:23
meeram3953-Jan-06 0:23 
GeneralRe: Saving an Excel Workbook in C# Pin
AB77713-Jan-06 18:03
AB77713-Jan-06 18:03 
GeneralRe: Saving an Excel Workbook in C# Pin
meeram3955-Jan-06 2:04
meeram3955-Jan-06 2:04 
Hi Pramod,

Thank you once again for the reply. Here is the code I have written.

private void ActivateExcel(DataSet M_Dataset, string filename)
{
Excel.ApplicationClass _excel=new Excel.ApplicationClass();
_excel.Application.Workbooks.Add(true);
Worksheets sheets = _excel.Worksheets;
sheets.Add();
Worksheet sheet = sheets[1];

DataTable xlsTbl=M_Dataset.Tables[0];
int ColumnIndex=0;
foreach(DataColumn col in xlsTbl.Columns)
{
ColumnIndex++;
_excel.Cells[1,ColumnIndex]=col.ColumnName;
}

int rowIndex=0;
foreach(DataRow row in xlsTbl.Rows)
{
rowIndex++;
ColumnIndex=0;
foreach(DataColumn col in xlsTbl.Columns)
{
ColumnIndex++;
_excel.Cells[rowIndex+1,ColumnIndex]=row[col.ColumnName];
}
_excel.Application.Save(filename);
}
}

I 'm also calling this function in several places by changing the dataset and file name paramters. I want to put the datasets in separate work sheets but one single work book. That is the requiremnt.

Thanking you once again for your attitude in helping me. Expecting your reply.

Regards

Raja Raman S
Reuters India Pvt.Ltd.
Bangalore
GeneralRe: Saving an Excel Workbook in C# Pin
AB77715-Jan-06 2:46
AB77715-Jan-06 2:46 
QuestionCrystal Report For VS 2005 Setup File Pin
ayuba asia1-Jan-06 21:30
ayuba asia1-Jan-06 21:30 
AnswerRe: Crystal Report For VS 2005 Setup File Pin
S. Akif Kamal2-Jan-06 19:57
S. Akif Kamal2-Jan-06 19:57 
GeneralRe: Crystal Report For VS 2005 Setup File Pin
ayuba asia4-Jan-06 2:11
ayuba asia4-Jan-06 2:11 
Questionhow can i load data to listview from MySql database Pin
azmafaridah1-Jan-06 21:10
azmafaridah1-Jan-06 21:10 
AnswerRe: how can i load data to listview from MySql database Pin
OneSoftware1-Jan-06 23:53
OneSoftware1-Jan-06 23:53 
Questioncreating directory Pin
pankaj b1-Jan-06 21:04
pankaj b1-Jan-06 21:04 
AnswerRe: creating directory Pin
Abdul Raheem Farooq1-Jan-06 21:38
Abdul Raheem Farooq1-Jan-06 21:38 
Questiongetting hole when updating dataadapter Pin
nitinbourai1-Jan-06 20:50
nitinbourai1-Jan-06 20:50 
QuestionRappi.dll Pin
jayshml1-Jan-06 20:28
jayshml1-Jan-06 20:28 
AnswerRe: Rappi.dll Pin
leppie1-Jan-06 20:37
leppie1-Jan-06 20:37 
GeneralRe: Rappi.dll Pin
WillemM1-Jan-06 23:42
WillemM1-Jan-06 23:42 
GeneralRe: Rappi.dll Pin
MalikRizwan2-Jan-06 1:48
MalikRizwan2-Jan-06 1:48 
Question(((((((How do I send a message!)))))) Pin
peshkunta1-Jan-06 18:50
peshkunta1-Jan-06 18:50 
AnswerRe: (((((((How do I send a message!)))))) Pin
MohammadAmiry1-Jan-06 20:22
MohammadAmiry1-Jan-06 20:22 
GeneralRe: (((((((How do I send a message!)))))) Pin
peshkunta1-Jan-06 23:09
peshkunta1-Jan-06 23:09 
QuestionHow to make CHM help file Pin
pmasknguyen1-Jan-06 18:29
pmasknguyen1-Jan-06 18:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.