Пример #1
0
        private void btnDis_Click(object sender, System.EventArgs e)
        {
            try
            {
                string strFrom = this.dtpFrom.Value.ToShortDateString();
                strFrom = strFrom + " " + this.numStart.Value.ToString().Trim() + ":00:00";
                string strTo = this.dtpTo.Value.ToShortDateString();
                strTo = strTo + " " + this.numEnd.Value.ToString().Trim() + ":00:00";

                if (this.trvWel.SelectedNode == null)
                {
                    MessageBox.Show("请选中一个站点!");
                    return;
                }

                string strZhanInfo = this.trvWel.SelectedNode.Text.Trim();

                if (strZhanInfo.IndexOf("|") < 0)
                {
                    MessageBox.Show("请选中一个站点!");
                    return;
                }

                string strZhanNo = strZhanInfo.Substring(0, strZhanInfo.IndexOf("|"));

                DataTable dt = new DataTable();

                if (comReport.CReports.getDtDetailReport(strZhanNo, strFrom, strTo, ref dt) == false)
                {
                    return;
                }

                Hashtable ht = new Hashtable();

                if (comReport.CReports.getHtTitles("colNames.xml", ref ht) == false)
                {
                    return;
                }


                BengZhan.comReport._9.crp9 crp = new BengZhan.comReport._9.crp9();
                DataTable dtDetail             = new DataTable();

                if (comReport.CReports.getDtDetailReport(strZhanNo, strFrom, strTo, ref dtDetail) == false)
                {
                    return;
                }

                string strTime = String.Format("{0}至{1}", strFrom, strTo);



                comReport.CReports.showReport(this.crpvWater, dtDetail, ht, crp, "供热明细表", strTime);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Пример #2
0
        private void paintRep(string strZhanNo)
        {
            try
            {
                string strFrom = this.dtpFrom.Value.ToShortDateString();
                strFrom = strFrom + " " + this.numStart.Value.ToString().Trim() + ":00:00";
                string strTo = this.dtpTo.Value.ToShortDateString();
                strTo = strTo + " " + this.numEnd.Value.ToString().Trim() + ":00:00";

                DataTable dt = new DataTable();

                if (comReport.CReports.getDtDetailReport(strZhanNo, strFrom, strTo, ref dt) == false)
                {
                    return;
                }

                Hashtable ht = new Hashtable();

                if (comReport.CReports.getHtTitles("colNames.xml", ref ht) == false)
                {
                    return;
                }


                BengZhan.comReport._9.crp9 crp = new BengZhan.comReport._9.crp9();
                DataTable dtDetail             = new DataTable();

                if (comReport.CReports.getDtDetailReport(strZhanNo, strFrom, strTo, ref dtDetail) == false)
                {
                    return;
                }

                string strTime = String.Format("{0}至{1}", strFrom, strTo);

                comReport.CReports.showReport(this.crpvWater, dtDetail, ht, crp, "供热明细表", strTime);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Пример #3
0
        //9列显示
        public static bool showReport(CrystalDecisions.Windows.Forms.CrystalReportViewer crpvWater, DataTable dtRep, Hashtable htRep, BengZhan.comReport._9.crp9 crp, string strTitle, string strTime)
        {
            try
            {
                if (dtRep == null)
                {
                    return(false);
                }

                if (htRep == null)
                {
                    return(false);
                }

                for (int i = 0; i < crp.Section2.ReportObjects.Count; i++)
                {
                    if (crp.Section2.ReportObjects[i] is CrystalDecisions.CrystalReports.Engine.TextObject)
                    {
                        CrystalDecisions.CrystalReports.Engine.TextObject to = (CrystalDecisions.CrystalReports.Engine.TextObject)crp.Section2.ReportObjects[i];
                        if (to.Text.IndexOf("field") >= 0)
                        {
                            to.Text = htRep[to.Text.Trim()].ToString();
                        }
                        if (to.Text.Trim() == "")
                        {
                            to.Text = strTitle;
                        }
                        if (to.Text.Trim() == "time")
                        {
                            to.Text = strTime;
                        }
                    }
                }

                for (int i = 0; i < dtRep.Columns.Count; i++)
                {
                    int    j        = i + 1;
                    string strField = "field" + j.ToString();
                    dtRep.Columns[i].ColumnName = strField;
                }

                crp.SetDataSource(dtRep);

                crpvWater.ReportSource = crp;

                return(true);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
                return(false);
            }
        }
Пример #4
0
        private void btnDis_Click(object sender, System.EventArgs e)
        {
            try
            {
                string strFrom=this.dtpFrom.Value.ToShortDateString();
                strFrom=strFrom+" "+this.numStart.Value.ToString().Trim()+":00:00";
                string strTo=this.dtpTo.Value.ToShortDateString();
                strTo=strTo+" "+this.numEnd.Value.ToString().Trim()+":00:00";

                if(this.trvWel.SelectedNode==null)
                {
                    MessageBox.Show("��ѡ��һ��վ��!");
                    return;
                }

                string strZhanInfo=this.trvWel.SelectedNode.Text.Trim();

                if(strZhanInfo.IndexOf("|")<0)
                {
                    MessageBox.Show("��ѡ��һ��վ��!");
                    return;
                }

                string strZhanNo=strZhanInfo.Substring(0,strZhanInfo.IndexOf("|"));

                DataTable dt=new DataTable();

                if(comReport.CReports.getDtDetailReport(strZhanNo,strFrom,strTo,ref dt)==false)
                {
                    return;
                }

                Hashtable ht=new Hashtable();

                if(comReport.CReports.getHtTitles("colNames.xml",ref ht)==false)
                {
                    return;
                }

                BengZhan.comReport._9.crp9 crp=new BengZhan.comReport._9.crp9();
                DataTable dtDetail=new DataTable();

                if(comReport.CReports.getDtDetailReport(strZhanNo,strFrom,strTo,ref dtDetail)==false)
                {
                    return;
                }

                string strTime=String.Format("{0}��{1}",strFrom,strTo);

                comReport.CReports.showReport(this.crpvWater,dtDetail,ht,crp,"������ϸ��",strTime);

            }
            catch(Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Пример #5
0
        private void paintRep(string strZhanNo)
        {
            try
            {
                string strFrom=this.dtpFrom.Value.ToShortDateString();
                strFrom=strFrom+" "+this.numStart.Value.ToString().Trim()+":00:00";
                string strTo=this.dtpTo.Value.ToShortDateString();
                strTo=strTo+" "+this.numEnd.Value.ToString().Trim()+":00:00";

                DataTable dt=new DataTable();

                if(comReport.CReports.getDtDetailReport(strZhanNo,strFrom,strTo,ref dt)==false)
                {
                    return;
                }

                Hashtable ht=new Hashtable();

                if(comReport.CReports.getHtTitles("colNames.xml",ref ht)==false)
                {
                    return;
                }

                BengZhan.comReport._9.crp9 crp=new BengZhan.comReport._9.crp9();
                DataTable dtDetail=new DataTable();

                if(comReport.CReports.getDtDetailReport(strZhanNo,strFrom,strTo,ref dtDetail)==false)
                {
                    return;
                }

                string strTime=String.Format("{0}��{1}",strFrom,strTo);

                comReport.CReports.showReport(this.crpvWater,dtDetail,ht,crp,"������ϸ��",strTime);

            }
            catch(Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }