tags:

views:

32

answers:

0

Hi,

I am writing each row data in datatable to client side as a comma separated string using response.write and using the following code to get it downloaded at client side.

HttpContext.Current.Response.Clear(); // Clear the Response Object
HttpContext.Current.Response.ContentType = "application/ms-excel";
HttpContext.Current.Response.AddHeader("content-disposition", string.Format("attachment;filename={0}.xls", fileName)); // set the Content Header
HttpContext.Current.Response.BinaryWrite(bytearray); // Write the Byte[] to the output stream

HttpContext.Current.Response.End();

But in this case I can not specify a different excel sheet if the data is more than 63K.

Is it possible to specify the excel sheet while writing in this manner?