ASP.Net MVC 3 Razor 创建报告
我有带有 Razor 模板的 ASP.Net MVC3 项目,我需要制作一个用于汇总报告和详细报告的报告工具。
我不知道如何在 MVC3 中创建此类报告。谁能给我一个创建这些报告的例子吗?
I have ASP.Net MVC3 project with Razor template, and I need to make a reporting tool for summary reports and detailed reports.
I do not know how to create such reports in MVC3. Could anyone give me an example for creating these reports?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

发布评论
评论(2)
迷你仙2024-12-15 18:20:35
首先,我必须在我的项目中配置数据集。因为我使用存储过程,所以我必须在数据集中添加新的表适配器。
然后我在项目中添加新项目(用于报告文件)并使用报告向导设计报告。
之后,为了在我的项目中显示报告,我添加了新的 Web 表单,并在我的 Web 表单中拖动报告查看器和脚本管理器。选择设计视图来设置报告。
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" SizeToReportContent="true"
Font-Size="8pt" InteractiveDeviceInfos="(Collection)"
WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt">
<LocalReport ReportPath="Reports\rptbooking.rdlc">
<DataSources>
<rsweb:ReportDataSource DataSourceId="ObjectDataSource1" Name="DataSet1" />
</DataSources>
</LocalReport>
</rsweb:ReportViewer>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
OldValuesParameterFormatString="original_{0}" SelectMethod="GetData"
TypeName="rptBatchClose.RDYGetawayDataSetTableAdapters.DataTable1TableAdapter">
</asp:ObjectDataSource>
</div>
</form>
</body>
这是在我的 MVC3 项目中制作 SSRS 报告的简单方法。
~没有更多了~
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
没有内置的报告控件,但有一个用于显示图表的 HTML 帮助程序。请参阅此处示例
MVC 3 默认不支持 SSRS 报告,因此您需要使用报表查看器控件。可以找到解释如何执行此操作的文章 此处
There isn't a built-in control for reports, there is however an HTML helper for displaying charts. Please see example here
SSRS reports are not supported by default in MVC 3, therefore you need to use a report viewer control. Article explaning how to do this can be found here