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. Image for the cookie policy date
close icon

Excel workbook open in broswer is not working

Hi,

I am trying to open an excel workbook on the current browser by using IWorkBook.SaveAs(...), but it always open the dialog box instead of opening the excel file. Is there any setting or something that I have to do before using this function?

-- the code

objExcelWorkbook.SaveAs(strFile & ".xls", objResponse, ExcelDownloadType.Open)

Thank you in advance.


1 Reply

SR Sridhar Syncfusion Team July 25, 2011 12:29 PM UTC

Hi Megumi,

Thank you very much for using Syncfusion products.

We have ExcelDownloadType.Open and ExcelDownloadType.PrombtDialog which are store the excel file in local host and we can open it using MSExcel. Currently, we dont have the support to open the file with in browser.

We are having the workaround that sainge the worksheet or workbook as an HTML and open it in the browser.

Please go through the following link for saving the workbook as an HTML.

http://help.syncfusion.com/ug_92/Reporting/XlsIO/ASP.NET/default.htm?turl=Documents%2Fsheetorganization.htm

Given below the code snippet used to save the workbook as an HTML and opening in the browser.

//Saving workbook
workbook.SaveAsHtml(Server.MapPath("Sample.html"), HtmlSaveOptions.Default);

//Opening with the browser
ClientScript.RegisterClientScriptBlock(this.GetType(), "open", "window.open('Sample.html','_blank');", true);


We ae implementing the Excel Viewer and it will be avilable in the next release and we can make use of it to open the workbook in an browser.

Please let us know if you require any further clarifications.

Thanks,
Sridhar.S


Loader.
Live Chat Icon For mobile
Up arrow icon