When I send the excel doc to the browser and the user chooses Save As to save it to there computer is there anyway I can set the default filename for the Save As?
You can specify the filename in the save method. For example,
excel.Save(“Mybook.xls”, SaveType.OpenInBrowser, FileFormatType.Default, this.Response);
When I do that the Save As Defaults to "Form_Manager.aspx"
Basically whatever the page name is.
Do you mean that users open file in browser first, then choose “Save as”? In this case, the default file name cannot be specified in Aspose.Excel. It’s handled by IE.
Exactly.
We are using OpenInExcel now which works perfectly.
Thanks
@Marmot,
Aspose.Excel is deprecated now and no more available now. It is replaced by another latest product Aspose.Cells that has much more advanced features as compared to its predecessor product. You can generate a file dynamically and send it directly to client browser as demonstrated in the following sample code:
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
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();
}
For more examples please refer to the following articles:
Saving File to Response Object
You may try the latest free trail version of this product here:
Aspose.Cells for .NET (Latest Version)
You can test different features of this new product by downloading an executable solution here.