[英]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: 在以下两种情况下如何生成Excel文件:
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.
我希望在内存中生成Excel文件,并在生成时打开文件。 In case of the Web application I want it to show the download prompt before opening the generated Excel file.
对于Web应用程序,我希望它在打开生成的Excel文件之前显示下载提示。
An example would be really appreciated. 一个例子将不胜感激。
Thanks 谢谢
SpreadsheetGear 2012 for .NET could do this. .NET的SpreadsheetGear 2012可以做到这一点。 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.
就Web应用程序而言,请看一下任何Excel Reporting Samples ,它们都从头开始或从现有模板工作簿文件开始动态生成工作簿文件。 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. 而是将文件直接保存到
Response.OutputStream
,这将提示最终用户下载工作簿文件。
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. 就Windows应用程序而言,SpreadsheetGear 2012 for .NET可以从磁盘/字节数组/流中读取/写入工作簿文件,并且,如果需要,可以通过适用于Windows窗体和WPF的WorkbookView和FormulaBar控件提供丰富的交互式电子表格UI。 。 You might take a look at the following page for more information on these controls: http://www.spreadsheetgear.com/support/samples/windowsforms.aspx
您可以查看以下页面,以获取有关这些控件的更多信息: http : //www.spreadsheetgear.com/support/samples/windowsforms.aspx
Disclaimer: I work for SpreadsheetGear. 免责声明:我为SpreadsheetGear工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.