We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Save excel file to stream

I need to download my excel file on the bottom of the browser on a button click. What I’ve found so far is:

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
HttpResponse Response = null;

// Load your source workbook
Workbook workbook = new Workbook();

if (Response != null)
{
// Save in Excel2003 XLS format
workbook.Save(Response, dataDir + “output.xls”, ContentDisposition.Inline, new XlsSaveOptions());
Response.End();
}

In the above code, what is ContentDisposition class? It throws error on my VS2015. What is it’s parent library?

@imshealth,

  1. Please make sure that you are using Asp.NET web application/project in VS.NET.
  2. If you are already using web application/project, then check which Aspose.Cells.Dll from which folder you are using @ your installation directory. You should use Aspose.Cells dll found inside the net2.0 or net4.0 folder of your installation directory. You should read the readme.txt file.

Please note, the ClientProfile version is for Client Profile .NET Framework, you should not use it unless you are using .NET Client Profile Framework as your targeted framework for your console application project.

Let us know if you still have any issue.

And, Aspose.Cells.ContentDisposition is an enum.
PS. Please try our latest versions if you are using some older version.

Thank you.