zoukankan      html  css  js  c++  java
  • 水晶报表初体验(Visual Studio 2010)

    安装水晶报表后如下使用;

    配置rpt文件,如图

    前台(Asp.net页面):

     <%@ Register Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
        Namespace="CrystalDecisions.Web" TagPrefix="CR" %>
    
    <CR:CrystalReportViewer ID="ReTransport" runat="server" AutoDataBind="true" />

    后台:

    public void GetList()
            {
                ReportDocument doc = new ReportDocument();
                // rpt文件路径
                doc.Load(Server.MapPath("/Cry/CrystalInSchoolInfo.rpt"));
                ReTransport.ToolPanelView = ToolPanelViewType.None;
                Maticsoft.BLL.list.Lists pro = new Maticsoft.BLL.list.Lists();
                if (Session["CrystalData"]!=null)
                {
                    //配置数据源dataset
                    doc.SetDataSource((DataTable)Session["CrystalData"]);
                    this.ReTransport.ReportSource = doc;
                    this.ReTransport.DataBind();
                }
                else
                {
                    HttpContext.Current.Response.Write("<script>alert('连接超时,请刷新!');window.location.href=document.referrer;</script>");
                }
            }

    使用注意:rpt文件配置过程中,页面长度代表一列,若拉的太长,会默认增加到下一页,导致误判为无法遍历数据的错觉

    关于更高级的内嵌报表之类的,我就没有使用过了,以后边用边学吧。

    最后贴上Visual Studio 2010的水晶报表安装包下载地址:http://yunpan.cn/QC9fWzZdj64ER(提取码:a7b9)

  • 相关阅读:
    Codeforces 878A
    Codeforces 873B-Balanced Substring
    codeforces 868C
    51nod 1402 最大值(贪心)
    最小正子段和 贪心
    codeforces 819B
    Codeforces 785D
    Codeforces 864E
    863D
    UVA 1380 A Scheduling Problem
  • 原文地址:https://www.cnblogs.com/likeli/p/3884535.html
Copyright © 2011-2022 走看看