简体   繁体   English

ASP.Net Web服务器控件,用于生成HTML和Excel

[英]ASP.Net web server control that generates HTML and Excel

I am developing a web application that contains a great deal of reporting. 我正在开发一个包含大量报告的Web应用程序。 The reports are fairly basic, but some have multiple datasets or embedded charts. 报告相当基础,但有些报告有多个数据集或嵌入式图表。 One of the key requirements is that each report can be exported to Excel. 其中一个关键要求是每个报告都可以导出到Excel。 The Excel version of the report is disconnected and should look the same (or very similar) to the web report. 报告的Excel版本已断开连接,应与Web报告看起来相同(或非常相似)。 That includes formmating of values, cell styles, number of rows/columns, charts, etc. 这包括值的格式化,单元格样式,行/列数,图表等。

The problem I've encountered is that the ASP.Net reporting tools I've looked at do a great job in creating the report, but the export to Excel is not as robust as I'd like. 我遇到的问题是我看过的ASP.Net报告工具在创建报告方面做得很好,但导出到Excel并不像我想的那样强大。 The ASP.Net spreadsheet tools do a great job generating an Excel sheet, but they don't offer a way to view the information in a browser without downloading them locally and viewing them in Excel. ASP.Net电子表格工具可以很好地生成Excel工作表,但它们不提供在浏览器中查看信息的方法,无需在本地下载并在Excel中查看它们。

Any suggestions? 有什么建议么? Thanks! 谢谢!

MS Reporting Services that comes with SQL server produces pretty high fidelity Excel spreadsheets. SQL Server附带的MS Reporting Services可生成相当高保真的Excel电子表格。

Otherwise you could do this with MOSS Enterprise using Excel Services and the Excel Viewer web part. 否则,您可以使用Excel Services和Excel Viewer Web部件在MOSS Enterprise中执行此操作。

Infragistics has some fairly robust web controls, one of them is a grid that can export to Excel. Infragistics有一些相当强大的Web控件,其中一个是可以导出到Excel的网格。 The Excel export component allows you to format the results, add images and other stuff, so it should do what you are after. Excel导出组件允许您格式化结果,添加图像和其他内容,因此它应该完成您所追求的目标。

The only problem with Infragistics is that their API is extremely ... what is the word ... cumbersome? Infragistics的唯一问题是他们的API非常......这个词是什么......繁琐? So it takes some work to get used to and often much code to get things done properly. 因此,需要一些工作来习惯并经常使用大量代码来正确完成工作。 But the end result is good. 但最终结果是好的。

If you only want to generate Excel documents which are just cell data and not charts you can use the XML markup for Excel, no not the OpenXML spec version but the standard Microsoft Excel XML format. 如果您只想生成只是单元格而不是图表的Excel文档,则可以使用Excel的XML标记,不是OpenXML规范版本,而是标准Microsoft Excel XML格式。

I've got an example of how to achieve that on my blog: http://www.aaron-powell.com/blog.aspx?id=1237 . 我在博客上有一个如何实现这个目标的例子: http//www.aaron-powell.com/blog.aspx?id = 1237 If you do want to do charting I'm not 100% sure if it's supported that way. 如果你想做图表我不是100%确定它是否支持这种方式。

You could use SpreadsheetGear to generate the Excel version of your report, complete with macros and formatting. 您可以使用SpreadsheetGear生成报表的Excel版本,包括宏和格式。 The product give you complete programmatic control for creating a 97 - 07 compliant spreadsheet. 该产品为您提供了完整的编程控制,可用于创建符合97-07的电子表格。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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