Hi Telerik Team,
I am trying to export some data to excel and my code is as below:
I am trying to export some data to excel and my code is as below:
protected byte[] rptResult = null;
rptResult = //getdata here
Response.ClearContent();
Response.AppendHeader(
"content-length", this.rptResult.Length.ToString());
Response.AppendHeader(
"content-disposition", "attachment;filename=Test.xls");
Response.ContentType =
"application/vnd.ms-excel";
Response.Buffer =
true;
Response.BinaryWrite(
this.rptResult);
Response.Flush();
Response.Close();
But after executing I got an error like below:
Error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed.
I think the error is coming from the code like
Response.BinaryWrite(this.rptResult);
Waiting for the reply
Dayana