asp.net mvc中应用Grid++ Report (基本应用示例)

版权声明:本文为博主原创文章,未经博主允许不得转载。文章来源:http://blog.csdn.net/wcj920946195 https://blog.csdn.net/wcj920946195/article/details/51779564

cshtml文件:

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <script src="~/Report/CreateControl.js" type="text/javascript"></script>
</head>
<body>
    <script type="text/javascript">
        CreateDisplayViewerEx("100%", "100%", '@Url.Content("~/Report/wcjGridTest.grf")', '@Url.Action("getDataForReport", "GridPrintTest")', true, "");
    </script>
</body>
</html>

config文件:(如果是vs2013需要配置,目的是给iis的mime添加新的静态处理类型)

<system.webServer>
    <staticContent>
      <mimeMap fileExtension=".grf"  mimeType="grf/gridreport" />
    </staticContent>
</system.webServer>

控制器:

 public class GridPrintTestController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }
        public ActionResult getDataForReport()
        {
            string xml = OracleHelper.Query("select * from  NS_FEEDBACK_TYPE_DIC").GetXml();
            return Content(xml);
        }
    }

文章来源:http://blog.csdn.net/wcj920946195

展开阅读全文

没有更多推荐了,返回首页