Hi,
Changing to ContentDisposition.Inline does get rid of the Protected View message. However, once the Aspose Save method is called, we get a dialog asking if the file should be opened or saved and when we click Open, the page load runs 3 more times before the spreadsheet actually displays. This will cause a big performance issue for our actual applications which do a lot of data processing. Can you explain how this can be avoided?
Well, well the Workbook.Save() overloads involving Response object is nothing but equivalent to:
e.g.
[C#]
//................
workbook.Save(stream, new OoxmlSaveOptions(SaveFormat.Xlsx));
//Send the stream back to the client
this.Response.AddHeader("Content-Type", "application/xlsx");
this.Response.AddHeader("Content-Disposition", "inline; filename=Report.xlsx");
this.Response.BinaryWrite(ms.ToArray());
We do not do anything different than above. You may even Replace the Workbook.Save() method with the above lines.
Well, we do not find your issue at all (“PageLoad runs 3 more times… etc.”), it might be due to your own project’s structure or codes etc. By the way, you may try to add a line to your code (if it works fine) after Workbook.Save() or Response.BinaryWrite() method:
Response.End()
I would also like to understand what the difference between ContentDisposition Inline and Attachment is with respect to Aspose.Cells.
There is nothing special between Inline and Attachment. Inline refers to OpenInBrowser and Attachment may refer to OpenInExcel options.
See the document for your complete reference on Workbook.Save() method’s options:
In short, we do not find the issue whether we use Attachment or Inline option, if you still could not evaluate, please create a sample project and attach it here to reproduce the issue on our end. If possible, please do not post your attachments via using emails, you may either attach your attachments here or even use some free drives e.g. skydrive (you may upload there) to share the links here for everybody’s review.
Thank you.