We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

The message received from server could not be parsed.

Thread ID:

Created:

Updated:

Platform:

Replies:

75153 Jul 15,2008 06:13 AM UTC Jul 15,2008 07:18 AM UTC ASP.NET Web Forms (Classic) 3
loading
Tags: XlsIO
Administrator [Syncfusion]
Asked On July 15, 2008 06:13 AM UTC

Hi,
I developed export to excel file for one ASP.NET app. And i have following error:

The message received from server could not be parsed.

Code (in short):
byte[] file = new byte[500000];
...
using (SqlDataReader rr =
c.ExecuteReader(CommandBehavior.SingleRow))
{
rr.Read();
file = ((byte[])rr["EXPORT_EXCEL_TEMPLATE"]);
}

System.IO.FileStream fileStream = System.IO.File.Create(path);
fileStream.Write(file, 0, file.Length);
fileStream.Close();
ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;
IWorkbook workbook = application.Workbooks.Open(path);
IWorksheet sheet = workbook.Worksheets[0];


//FILLING EXCEL FILE


workbook.SaveAs("Soubor.xls", ExcelSaveType.SaveAsXLS, Response, ExcelDownloadType.PromptDialog);

And after that i see the error messsage.

When i use:

workbook.SaveAs("D:\\File.xls");

Everythink is OK, file is right and can be opened by MS Excel.

But when i use:

Response.Write(workbook);
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("Content-Disposition", "attachment; filename=PorovUkazatelu.xls;");
Response.Charset = "windows-1250";
Response.ContentEncoding = System.Text.Encoding.GetEncoding(1250);

Message is showen again.

So file is OK, but canot be sended via Response. Can somebody help me?



error_8badde5e.zip

Yavanaarasi G [Syncfusion]
Replied On July 15, 2008 06:47 AM UTC

Hi Michal,

Thank you for your interest in Syncfusion products.

We suspect that the issue "The message received from the server could not be parsed" is due to you can't open an Excel file from within an Ajax update panel. This is because when you do an ASP.NET AJAX postback the return is parsed on the client by a Javascript code and different bits update different parts of your page. If the return is something that breaks the syntax ASP.NET AJAX is expecting you will get that error message. You can workaround this issue by setting EnablePartialRendering=false for ScriptManager.

Please refer the following link for more details.
http://forums.asp.net/p/1127991/1780067.aspx

Please try this and let me know if the problem still exists.

Regards,
G.Yavana


Administrator [Syncfusion]
Replied On July 15, 2008 06:59 AM UTC



>Hi Michal,

Thank you for your interest in Syncfusion products.

We suspect that the issue "The message received from the server could not be parsed" is due to you can't open an Excel file from within an Ajax update panel. This is because when you do an ASP.NET AJAX postback the return is parsed on the client by a Javascript code and different bits update different parts of your page. If the return is something that breaks the syntax ASP.NET AJAX is expecting you will get that error message. You can workaround this issue by setting EnablePartialRendering=false for ScriptManager.

Please refer the following link for more details.
http://forums.asp.net/p/1127991/1780067.aspx

Please try this and let me know if the problem still exists.

Regards,
G.Yavana



Thank you very much, now it works fine!


Yavanaarasi G [Syncfusion]
Replied On July 15, 2008 07:18 AM UTC

Hi Michal,

Thank you for your update.

Glad to hear that the problem has been solved.

Please let me know if you have any other concerns.

Regards,
G.Yavana


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;