编写数据报告的简单方法

发布于 2024-08-13 16:33:30 字数 131 浏览 5 评论 0原文

正在寻找一种简单的方法来生成有关我的应用程序所保存的数据的报告。

有没有更简单的方法,而不是通过将其全部写出来并使用 /n 等进行格式化来痛苦地构建它?它可以是Excel,或者只是一个列表...也许唯一的方法就是像我想的那样做...

looking for a good easy way to generate reports on data my application holds.

rather than building it painfully by writing it all out and formatting it with /n 's etc is there an easier method? It could be into excel, or just a list... Maybe the only way is to do it like I was thinking...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

疏忽 2024-08-20 16:33:30

尝试创建一个 csv 文件(逗号分隔值)...很容易生成

姓名、作者、年份
lotr、jr tolkien、1995

excel可以打开csv文件

try creating a csv file (comma seperated values)... its easy to generate

name, author, year
lotr, jr tolkien, 1995

and so on

excel can open csv files

谁对谁错谁最难过 2024-08-20 16:33:30

SQL Server 报告服务 (SSRS) 是一个很好的报告选项,特别是因为您可以在 SQL Express 上免费运行它。但如果您想要的只是一两个不会改变的简单报告,那么这可能有点矫枉过正。

ASPX 在这种情况下,拥有一个包含将数据绑定到的 gridview 或 listview 的 aspx 页面会相对简单,或者您可以生成一个 HTML 页面,其中的数据格式为一张桌子。我之所以提到在 aspx 或网页中执行此操作,是因为它简化了您的打印和显示选项。

其他工具 当然,还有其他报告工具集可供您查看,但它们总是会给您的应用程序添加额外的依赖项或复杂性。

SQL Server Reporting Sercices (SSRS) is a good reporting option, especially as you can run it for free on top of SQL Express. But it might be a bit of overkill if all you want is one or two simple reprots which will not change.

ASPX In that case it would be relatively simple to have an aspx page that contains either a gridview or listview which you bind your data in to, or you could just generate an HTML page with the data formatted in to a table. The reason why i mention doing it in an aspx or web page is that it simplifies your printing and display options.

Other Tools Of course there are other reporting toolsets out there which you should check out, but invariably they will add extra dependencies or complexities to your application.

一片旧的回忆 2024-08-20 16:33:30

EXCEL 如果您的用户安装了 Excel,您可以从 C# 或 Excel 查询将数据写入 Excel 工作表。

标准报告包 如果您的 2008 标签意味着 SQL Server 2008,那么您已经拥有报告服务 - 这是一个非常好的选择。您可以进行比较研究,

我绝对建议使用标准报告包(Excel、SSRS、Crystal 等),而不是使用 HTML 或 ASPX 手动构建报告包。

EXCEL If your users have Excel installed, you can write data to Excel sheets from C# or from Excel queries.

Standard Reporting Packages If your 2008 tag meant SQL Server 2008, then you already have reporting services - that is a really good option. You can investigate compar

I definitely recommend going with a standard reporting package (Excel, SSRS, Crystal, etc) rather than building one by hand using HTML or ASPX.

妳是的陽光 2024-08-20 16:33:30

为什么不根据要输出的数据创建一个 XML 文档(确保将大于/小于/与符号/引号格式化为 html 实体),应用 XML/XSLT 样式表将其转换为生成 html文档。使用 WebBrowser 控件,您可以将其用作“报告查看器”并可以将其打印出来。以前做过这个并且很成功。好吧,这可能听起来很荒谬,但这是最接近报道目标的事情。我当时没有 Crystal Reports,但是它对我很有用。想一想,假设你想改变布局。保留 XML 文档,但更改 XSLT 样式表以满足您的需要。有一个大问题我没有取得太大成功,考虑到每页的行数,因为尝试使用 XPATH 代码来做到这一点有点笨拙......您对此有何看法?

希望这有帮助,
此致,
汤姆.

Why not create an XML document based on the data that you want to be outputted (be sure you format the greater than/less than/ampersand/quotes into a html entity), apply an XML/XSLT stylesheet to transform it to generate a html document. Using a WebBrowser Control, you can use that as a "Report Viewer" and can print it out. Have done this before and it was successful. Ok, it may sound ridiculous but it was the nearest thing to the grail of reporting. I did not have Crystal Reports at the time but hey it worked for me. Think about it, suppose you want to change the layout. Leave the XML document alone, but change the XSLT stylesheet to suit your needs. There is one big gotcha that I have not had much success with, taking into account of number of lines per page as trying to do that with XPATH code was somewhat kludgy...What do you think of this?

Hope this helps,
Best regards,
Tom.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文