zoukankan      html  css  js  c++  java
  • Dev 报表——MVC 中使用(版本号:15.2 )

    /////////////////////////////////效果图/////////////////////////////////////////////////////

    /////////////////////////////////前端代码////////////////////////////////////////////////////

    ////////////////////Index.cshtml/////////////////////////////////////////////////// 

    @{
    ViewBag.Title = "Index";
    Layout = null;
    }
    @Html.DevExpress().GetStyleSheets(
    new StyleSheet { ExtensionSuite = ExtensionSuite.NavigationAndLayout },
    new StyleSheet { ExtensionSuite = ExtensionSuite.Editors },
    new StyleSheet { ExtensionSuite = ExtensionSuite.HtmlEditor },
    new StyleSheet { ExtensionSuite = ExtensionSuite.GridView },
    new StyleSheet { ExtensionSuite = ExtensionSuite.CardView },
    new StyleSheet { ExtensionSuite = ExtensionSuite.PivotGrid },
    new StyleSheet { ExtensionSuite = ExtensionSuite.Chart },
    new StyleSheet { ExtensionSuite = ExtensionSuite.Report },
    new StyleSheet { ExtensionSuite = ExtensionSuite.Scheduler },
    new StyleSheet { ExtensionSuite = ExtensionSuite.TreeList },
    new StyleSheet { ExtensionSuite = ExtensionSuite.RichEdit },
    new StyleSheet { ExtensionSuite = ExtensionSuite.Spreadsheet },
    new StyleSheet { ExtensionSuite = ExtensionSuite.SpellChecker }
    )
    @Html.DevExpress().GetScripts(
    new Script { ExtensionSuite = ExtensionSuite.NavigationAndLayout },
    new Script { ExtensionSuite = ExtensionSuite.HtmlEditor },
    new Script { ExtensionSuite = ExtensionSuite.GridView },
    new Script { ExtensionSuite = ExtensionSuite.CardView },
    new Script { ExtensionSuite = ExtensionSuite.PivotGrid },
    new Script { ExtensionSuite = ExtensionSuite.Editors },
    new Script { ExtensionSuite = ExtensionSuite.Chart },
    new Script { ExtensionSuite = ExtensionSuite.Report },
    new Script { ExtensionSuite = ExtensionSuite.Scheduler },
    new Script { ExtensionSuite = ExtensionSuite.TreeList },
    new Script { ExtensionSuite = ExtensionSuite.RichEdit },
    new Script { ExtensionSuite = ExtensionSuite.Spreadsheet },
    new Script { ExtensionSuite = ExtensionSuite.SpellChecker }
    )
    @Html.Action("DocumentViewerPartial")

    ///////////////////////////_DocumentViewerPartial.cshtml///////////////////////////

    @Html.DevExpress().DocumentViewer(settings => {
    settings.Name = "DocumentViewer";
    settings.CallbackRouteValues = new { Controller = "Current", Action = "DocumentViewerPartial" };
    settings.ExportRouteValues = new { Controller = "Current", Action = "DocumentViewerPartialExport" };
    settings.Report = (XtraReport)Model;
    settings.ToolbarMode = DocumentViewerToolbarMode.StandardToolbar;
    }).GetHtml()

    /////////////////////////////////后端代码///////////////////////////////////////////////////

    public ActionResult Index()
    {
    return View();
    }

    XtraReport1 report = new XtraReport1();

    public ActionResult DocumentViewerPartial()
    {
    return PartialView("_DocumentViewerPartial", report);
    }

    public ActionResult DocumentViewerPartialExport()
    {
    return DocumentViewerExtension.ExportTo(report, Request);
    }

    /////////////////////////////////////////说明////////////////////////////////

    1、报表代码 拷贝之前文章中的dev报表中的代码即可

    2、报表版本:15.2 

    3、以下为网站的web.config ,把view下的web.config 对应的配置给删除

     4.直接在页面中点击右键添加报表就可以省去很多的引用问题

  • 相关阅读:
    关闭窗体后,利用StreamWriter保存控件里面的数据
    ref传递
    C# 特性 Attribute
    关键字 new 的作用
    关键字 base 的作用
    关键字 this 的作用
    random类的使用
    数据库结果为 基于左右值排序的无限分类算法
    PHP显示日期、周几、农历初几、什么节日函数编程代码
    描述了say_hello函数的具体内容,调用zend_printf系统函数在php中打印字符串
  • 原文地址:https://www.cnblogs.com/5tomorrow/p/5862730.html
Copyright © 2011-2022 走看看