日期:2014-05-17  浏览次数:20717 次

rdlc报表的钻取 求教



//报表钻取
        protected void ReportViewer1_Drillthrough(object sender, DrillthroughEventArgs e)
        {
            //Convert.ToString(ERCBasicInfoBLL.SelectCodeName(basicinfo.ProvCode)) + Convert.ToString(ERCBasicInfoBLL.SelectCodeName(basicinfo.WorkItemAreaCode)) + Convert.ToString(ERCBasicInfoBLL.SelectCodeName(basicinfo.CountyCode));
            LocalReport lp = (LocalReport)e.Report;
            string custdate = lp.GetParameters()["date"].Values[0].Trim();

                       DataTable datas1 = new DataTable();

            datas1.Columns.Add("erccode", typeof(string));
            datas1.Columns.Add("ercname", typeof(string));
            datas1.Columns.Add("tphone", typeof(string));
            datas1.Columns.Add("address", typeof(string));
            datas1.Columns.Add("noid", typeof(string));
            datas1.Columns.Add("createtime", typeof(string));
            datas1.Columns.Add("createaddress", typeof(string));
            datas1.Columns.Add("status", typeof(int));
            datas1.Columns.Add("isPubTB", typeof(int));
            datas1.Columns.Add("isStaTB", typeof(int));


            DataTable BasicTB = ERCBasicInfoBLL.GetBasiEdits(custdate);
            foreach (DataRow dr in BasicTB.Rows)
            {
                DataRow dra = datas1.NewRow();
                dra["erccode"] = dr["ERCCode"];
                dra["ercname"] = dr["ERCName"];
                dra["tphone"] = dr["ContactPhone"];
                dra["address"] = dr["Address"];
                dra["noid"] = dr["LegalPersonCardNum"];
                dra["createtime"] = dr["CreateTime"];
                datas1.Rows.Add(dra);