Save PDF within bootstrap modal attempts to render file

Hi,





I’m using Aspose to create an Excel file within a website developed in C# MVC. I have created the form used to generate the Excel file within a modal window. This form contains a submit button that when clicked, would call the save function to create file via the following command (bk is the name of the workbook):





bk.Save(System.Web.HttpContext.Current.Response, “PrintClientReport.xlsx”, ContentDisposition.Attachment, new OoxmlSaveOptions(SaveFormat.Xlsx));







What is happening is that the modal window attempts to render the file after it is created. As a result, I see a lot of weird binary characters in the modal window.







What I want to happen is that after it creates the file, the file will be sent to the client browser and a link to it will appear on the bottom left corner of the browser. If I move the function to the parent window (e.g. outside the bootstrap modal), it works fine.







Sincerely,





Jason



Hi,


Thanks for your posting and considering Aspose.Cells.

Workbook object can be saved to memory stream (please check different overloads of Save() method). From memory stream, you can get bytes. So please check, if you can send bytes or memory stream (or stream) object to user (i.e. client) from your MVC application. If yes, then you should be able to resolve your problem.

Please check this thread and see if it is of any help for you. If it does not help, then please share with us your simplest MVC application which we could run at our end and replicate and fix your issue.