C# 报告(免费 || 开源)Winforms 中 Crystal Reports 的替代方案
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/788923/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Reporting (free || open source) Alternatives to Crystal Reports in Winforms
提问by Jhonny D. Cano -Leftware-
In my winforms project I'm looking for a Crystal Report's like solution free or open source that allows me printing and PDF'ing the Content of a DataSet. ?Any suggestion or Ideas?
在我的 winforms 项目中,我正在寻找类似于 Crystal Report 的免费或开源解决方案,它允许我打印和 PDF 处理数据集的内容。?任何建议或想?
I need something simple but fast, Crystal seems very slow for me. Thanks in advance.
我需要一些简单但快速的东西,Crystal 对我来说似乎很慢。提前致谢。
I'm aware of this questionbut it seems to me there are just answers related to java
我知道这个问题,但在我看来只有与 java 相关的答案
采纳答案by Chris Doggett
You could always roll your own. I'm getting rid of Crystal Reports in our project because currently, we can't update our old reports without upgrading everyone to XP, because we develop in VS 2008, and the new CR doesn't support Win2K. Also, CR takes about 30 seconds to build and load the report, mine is instantaneous.
你总是可以推出自己的。我在我们的项目中摆脱了 Crystal Reports,因为目前,我们不能在不升级所有人到 XP 的情况下更新我们的旧报告,因为我们在 VS 2008 中开发,而新的 CR 不支持 Win2K。此外,CR 需要大约 30 秒来构建和加载报告,我的是即时的。
I wrote my own XML serializer, and I build custom objects that are populated from List<T>s, DataTables, etc..., serialize the object, load it into an XmlDocument, append an XSLT stylesheet, and write it to a directory containing that XSLT file and any CSS and images. The XSLT file then transforms it to HTML/CSS when the XML file is opened in the user's browser.
我编写了自己的 XML 序列化程序,并构建了从 List<T>s、DataTables 等填充的自定义对象,序列化对象,将其加载到 XmlDocument 中,附加 XSLT 样式表,并将其写入目录包含该 XSLT 文件和任何 CSS 和图像。当 XML 文件在用户浏览器中打开时,XSLT 文件将其转换为 HTML/CSS。
I could also probably load it into a WebBrowser control and use one of the free PDF libraries to convert it to PDF and print it. See these threads for more details:
我也可以将它加载到 WebBrowser 控件中,然后使用免费的 PDF 库之一将其转换为 PDF 并打印出来。有关更多详细信息,请参阅这些主题:
回答by Ben Martin
You could use the MS Report Viewerin local mode or the open source fyiReporting RDL Project
您可以在本地模式下使用MS 报告查看器或开源fyiReporting RDL 项目
回答by runxc1 Bret Ferrier
I would suggest that you use the fyiReporting(Forked and Moved Now Current as of 2012) tool if you are looking to replace Crystal Reports. I have used both fyiReporting and Crystal and would have to say that I prefer fyiReporting(though their website is ghetto).
如果您想替换 Crystal Reports ,我建议您使用fyiReporting(2012 年的分叉和移动当前)工具。我使用过 fyiReporting 和 Crystal,不得不说我更喜欢 fyiReporting(尽管他们的网站是贫民窟)。
Reasons for choosing fyiReporting
选择 fyiReporting 的理由
If you want to replace Crystal then you are used to having a Report designer. FyiReporting has its own GUI just like Crystal Reports for creating and running reports(You could just create and distribute reports without building an application).
FyiReports allows you to export the Report as PDF, excel and mht(static web page) just to mention a few.
FyiReports are xml based so the report definition can be saved in a database and altered at anytime.
If you are using .Net FyiReporting has a Web and Windows Forms control for embedding the report in your applications(much like crystal reports). I am not so sure about Java as I am a .Net guy.
如果您想替换 Crystal,那么您已经习惯了拥有报表设计器。FyiReporting 有自己的 GUI,就像 Crystal Reports 一样用于创建和运行报表(您可以创建和分发报表,而无需构建应用程序)。
FyiReports 允许您将报告导出为 PDF、excel 和 mht(静态网页),仅举几例。
FyiReports 是基于 xml 的,因此报告定义可以保存在数据库中并随时更改。
如果您使用 .Net FyiReporting 有一个 Web 和 Windows 窗体控件,用于将报表嵌入到您的应用程序中(很像水晶报表)。我对 Java 不太确定,因为我是一个 .Net 人。
Anyway give FyiReports a try.
无论如何,请尝试一下 FyiReports。
回答by lothar
BIRT, the EclipseBusiness Intelligence and Reporting Toolis open source.
BIRT is an open source Eclipse-based reporting system that integrates with your Java/J2EE application to produce compelling reports. BIRT provides core reporting features such as report layout, data access and scripting.
BIRT 是一个基于 Eclipse 的开源报告系统,它与您的 Java/J2EE 应用程序集成以生成引人注目的报告。BIRT 提供核心报告功能,例如报告布局、数据访问和脚本编写。
回答by Nathan Feger
JasperReports: http://jasperforge.org.
JasperReports:http: //jasperforge.org。
openreports: http://oreports.com/For hosting jasper files.
openreports:http://oreports.com/ 用于托管 jasper 文件。
Not specifically a reporting tool but displaytag is a simple java tag that will emit, csv, xls and pdf.
不是专门的报告工具,但 displaytag 是一个简单的 java 标签,它将发出 csv、xls 和 pdf。
回答by GregC
Free to try with a nagging banner... DevExpress XtraReports and XRCharts. Very nice dev tool, great support, speaking from experience.
免费尝试使用烦人的横幅... DevExpress XtraReports 和 XRCharts。非常好的开发工具,很好的支持,经验之谈。
回答by Macros
If you are using Sql Server (any edition, even express) then you can install Sql Server Reporting Services. This allows the creation of reports through a visual studio plugin, or through a browser control and can export the reports in a variety of formats, including PDF. You can view the reports through the winforms report viewer control which is included, or take advantage of all of the built in generated web content.
如果您使用的是 Sql Server(任何版本,甚至是 express),那么您可以安装 Sql Server Reporting Services。这允许通过 Visual Studio 插件或浏览器控件创建报告,并可以导出各种格式的报告,包括 PDF。您可以通过包含的 winforms 报告查看器控件查看报告,或利用所有内置生成的 Web 内容。
The learning curve is not very steep at all if you are used to using datasets in Visual Studio.
如果您习惯于在 Visual Studio 中使用数据集,学习曲线就不会很陡峭。
回答by blu
You can use an RDLC fileprovided in visual studio to define your report layout. You can view the rdlc using the ReportViewer control.
您可以使用Visual Studio 中提供的RDLC 文件来定义您的报表布局。您可以使用ReportViewer 控件查看 rdlc 。
Both are provided out of the box with visual studio.
两者都是开箱即用的 Visual Studio。
回答by Zaffiro
You could try implemeting something like this: http://www.codeproject.com/KB/cs/reporting__windowsforms.aspx
你可以尝试实现这样的东西:http: //www.codeproject.com/KB/cs/reporting__windowsforms.aspx