·您现在的位置: 云翼网络 >> 文章中心 >> 网站建设 >> 网站建设开发 >> ASP.NET网站开发 >> 在asp.net mvc中如何使用Grid++ Report (锐浪报表)

在asp.net mvc中如何使用Grid++ Report (锐浪报表)

作者:佚名      ASP.NET网站开发编辑:admin      更新时间:2022-07-23

在asp.net mvc中如何使用Grid++ Report (锐浪报表)

在asp.net mvc中如何使用Grid++ Report (锐浪报表) 在cshtml,razor中的处理方法

以官方的asp.net(csharp)中的第一个示例"1a.简单表格"为例:视图: <script src="./Scripts/CreateControl.js" type="text/javascript"></script><script type="text/Javascript">CreateDisplayViewerEx("100%", "100%", '@Url.Content("~/grf/1a.grf")', '@Url.Action("ViewTest_Query","Login")', true, "");</script>后台:

public ActionResult ViewTest_Query() { return Content(OledbReportData.DoGenDetailData2("select * from Customers order by CustomerID").Getxml()); }

OledbReportData.DoGenDetailData2我自己写的方法,就是返回一个dataset public static DataSet DoGenDetailData2(string QuerySQL) { OleDbConnection ReportConn = new OleDbConnection(OleDbConnStr); OleDbDataAdapter ReportDataAdapter = new OleDbDataAdapter(QuerySQL, ReportConn); DataSet ReportDataSet = new DataSet(); ReportConn.Open(); ReportDataAdapter.Fill(ReportDataSet); ReportConn.Close(); return ReportDataSet; }

文件用到的类都在官方示例中.

希望能帮到你.