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

来源:互联网 发布:手机防沉溺软件 编辑:程序博客网 时间:2024/04/29 06:04

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

0 0
原创粉丝点击