or
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


Protected Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click For Each item As GridDataItem In RadGrid1.Items item.Style("background-color") = "#FFFFFF" Next RadGrid1.MasterTableView.BorderStyle = BorderStyle.None Dim fileName As String = "myExceltest.pdf" RadGrid1.MasterTableView.ExportToPdf() End Sub