首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

有哪位高手可以帮帮忙

2012-12-19 
有谁可以帮帮忙你好,我现在遇到个rdlc中的问题 就是说,rdlc中我用了四个矩阵展示数据,然后窗体中有四个che

有谁可以帮帮忙
你好,我现在遇到个rdlc中的问题 就是说,rdlc中我用了四个矩阵展示数据,然后窗体中有四个checkbox分别对应这四个矩阵,初始化时他是默认选中的,但我取消选中时,他说对应的矩阵要隐藏(我是给了他个空值,但是这样一来,他就会显示好多空白区域,所以不行),相反,在选中时,他又出现,我想的是在后台用代码控制他的大小吧,不知道能行不?但是不知道怎么弄,有什么好的办法没??谢谢.... ...
[解决办法]
各位帮帮忙呀!!!!
我现在的问题是,每个矩阵的可见性还要与checkbox的状态有关联,窗体加载时是默认选中的,他是要显示呢(绑定数据),当我取消时,他要隐藏(也就是不绑定)
if (chkPatient.Checked == true)
            {
                BindPatient();  绑定数据        
            }
            else
            {
                      隐藏数据,不让他显示,也就是不绑定,关键是这里要怎么写啊(窗体加载时就绑定了得) ,我是给他了个空值,这样出现问题了,有空白区域,所以不知道该怎么弄了,请你帮帮忙吧。谢谢...
            }

我是这样绑定的
        //绑定病人信息
        public void BindPatient()
        {
            ReportParameter[] rptPataient;
            PatientBLL patBll = new PatientBLL();
            DataSet ds = patBll.getPatInfo();
            PatientInfo model = new PatientInfo();
            model.PatientID = ds.Tables[0].Rows[0]["PatientID"].ToString();
            model.PatientName = ds.Tables[0].Rows[0]["PatientName"].ToString();
            model.PatientSex = ds.Tables[0].Rows[0]["PatientSex"].ToString();
            model.PatientTele = ds.Tables[0].Rows[0]["PatientTele"].ToString();
            model.PatientAddress = ds.Tables[0].Rows[0]["PatientAddress"].ToString();
            model.PatientRemark = ds.Tables[0].Rows[0]["PatientRemark"].ToString();
            model.PatientAge = Convert.ToInt32(ds.Tables[0].Rows[0]["PatientAge"]);
            ReportParameter patID = new ReportParameter("patID", model.PatientID);
            ReportParameter patName = new ReportParameter("patName", model.PatientName);
            ReportParameter patSex = new ReportParameter("patSex", dealSex(model.PatientSex));
            ReportParameter patAge = new ReportParameter("patAge", Convert.ToInt32(model.PatientAge).ToString());
            ReportParameter patPhone = new ReportParameter("patPhone", model.PatientTele);
            ReportParameter patAddress = new ReportParameter("patAddress", model.PatientAddress);


            ReportParameter patRemark = new ReportParameter("patRemark", model.PatientRemark);
            rptPataient = new ReportParameter[] { patID, patName, patPhone, patSex, patAddress, patRemark, patAge };
            reportViewer1.LocalReport.SetParameters(rptPataient);
            this.reportViewer1.RefreshReport();
        }

我是在vs2005中弄,你帮我看看吧,rdlc报表我实在是不会,查了好多资料都未果,谢谢。。。将感激不尽...

热点排行