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

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章