Y
ysawant
Hello Guys,
If anybody can help me i am trying to a customized excel ,using OWC
in .net i write an Excel file but it is not allowing me to format.
SpreadsheetClass xlsheet = new SpreadsheetClass();
It is not allowing me to format the cells ,plz anybody can help me how
to do that since it seems there is problem in configuration
I had referenced MicrosoftOfficeWeb Components
Below is my code snippet
conn.Open();
SqlDataReader dr = this.sqlcmd.ExecuteReader();
int numbercols = dr.FieldCount;
int row=1;
while(dr.Read())
{
for(int i=0;i<=numbercols - 1 ;i++)
{
xlsheet.Cells[row,i+1] =dr.GetValue(i).ToString();
**** --- xlsheet.Cells[1,1].Font="true";
}
row++;
}
dr.Close();
conn.Close();
xlsheet.ActiveSheet.Protection.Enabled=true;
xlsheet.ActiveSheet.Export(Server.MapPath(".")+"\\"+
this.xlfile.Text,OWC.SheetExportActionEnum.ssExportActionNone);
}
If anybody can help me i am trying to a customized excel ,using OWC
in .net i write an Excel file but it is not allowing me to format.
SpreadsheetClass xlsheet = new SpreadsheetClass();
It is not allowing me to format the cells ,plz anybody can help me how
to do that since it seems there is problem in configuration
I had referenced MicrosoftOfficeWeb Components
Below is my code snippet
conn.Open();
SqlDataReader dr = this.sqlcmd.ExecuteReader();
int numbercols = dr.FieldCount;
int row=1;
while(dr.Read())
{
for(int i=0;i<=numbercols - 1 ;i++)
{
xlsheet.Cells[row,i+1] =dr.GetValue(i).ToString();
**** --- xlsheet.Cells[1,1].Font="true";
}
row++;
}
dr.Close();
conn.Close();
xlsheet.ActiveSheet.Protection.Enabled=true;
xlsheet.ActiveSheet.Export(Server.MapPath(".")+"\\"+
this.xlfile.Text,OWC.SheetExportActionEnum.ssExportActionNone);
}