简体   繁体   中英

how to generate excel file for a windows application using C# .net and a web application using C# ASP.NET

How to generate Excel file in the following 2 scenarios:

  1. For a Windows application using C# or VB .NET
  2. For a Web application using C# or VB ASP.NET

BUT without creating a local copy of the file. I want the Excel file to be generated in memory and open the file when generated. In case of the Web application I want it to show the download prompt before opening the generated Excel file.

An example would be really appreciated.

Thanks

SpreadsheetGear 2012 for .NET could do this. As far as a web application goes, take a look at any of the Excel Reporting Samples , which all dynamically generate a workbook file, starting either from scratch or from an existing template workbook file. In either case, a "local copy" of the workbook is not generated on disk; instead, a file is saved directly to Response.OutputStream , which would prompt the end-user to download the workbook file.

As far as a windows application goes, SpreadsheetGear 2012 for .NET can read/write workbook files from disk/byte array/stream as well as, if desired, provide a rich interactive spreadsheet UI via the WorkbookView and FormulaBar controls for Windows Forms and WPF. You might take a look at the following page for more information on these controls: http://www.spreadsheetgear.com/support/samples/windowsforms.aspx

Disclaimer: I work for SpreadsheetGear.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM