• 水晶报表初体验(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)

  • 相关阅读:
    Eclipse 开发过程中利用 JavaRebel 提高效率
    数字转化为大写中文
    网页变灰
    解决QQ截图无法在PS中粘贴
    ORACLE操作表时”资源正忙,需指定nowait"的解锁方法
    网页常用代码
    SQL Server 2000 删除注册的服务器
    GridView 显示序号
    读取Excel数据到DataTable
    清除SVN版本控制
  • 原文地址:https://www.cnblogs.com/likeli/p/3884535.html
Copyright © 2020-2023  润新知