Esempio n. 1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            TotalPipeMaterialCR rpt = new TotalPipeMaterialCR();

            rpt.Site = this.Site;
            return(rpt);
        }
Esempio n. 2
0
        private void TotalPipeMaterialForm_Load(object sender, EventArgs e)
        {
            // string sql = "SELECT * FROM fun_pipematerial_lsh where DRAWINGNO='" + DrawingNo + "' and projectid='" + ProjectNo + "'" + DTTZD + " order  by material desc ";
            //string DBConfig_sql = "Data Source=oidsnew;User ID=plm;Password=123!feed;Unicode=True";

            string sql = "";

            if (Flag == 0)
            {
                sql = "SELECT * FROM fun_pipematerial_lsh where DRAWINGNO='" + DrawingNo + "' and projectid='" + ProjectNo + "' and modifydrawingno is null  order  by material desc ";
            }
            if (Flag == 1)
            {
                sql = "SELECT * FROM fun_pipematerial_lsh where MODIFYDRAWINGNO='" + DrawingNo + "' and projectid='" + ProjectNo + "' and modifydrawingno is not  null  order  by material desc ";
            }



            DataSet           ds     = new DataSet();
            OracleConnection  sqlCon = new OracleConnection(DataAccess.OIDSConnStr);
            OracleCommand     sqlCmd = new OracleCommand(sql, sqlCon);
            OracleDataAdapter sqlAd  = new OracleDataAdapter();

            sqlAd.SelectCommand = sqlCmd;
            sqlAd.Fill(ds, "sql");

            cr = new TotalPipeMaterialCR();
            cr.Load(Application.StartupPath + "CrystalReport1.rpt");
            cr.SetDataSource(ds.Tables["sql"]);
            crystalReportViewer1.ReportSource = cr;



            //传递参数
            ParameterFields        paramFields    = crystalReportViewer1.ParameterFieldInfo;
            ParameterField         paramFrame     = paramFields["drawingno"];
            ParameterValues        FcurValues     = paramFrame.CurrentValues;
            ParameterDiscreteValue discreteValueF = new ParameterDiscreteValue();

            discreteValueF.Value = DrawingNo;
            FcurValues.Add(discreteValueF);


            crystalReportViewer1.ParameterFieldInfo = paramFields;
            crystalReportViewer1.Refresh();
        }
        private void TotalPipeMaterialForm_Load(object sender, EventArgs e)
        {
            // string sql = "SELECT * FROM fun_pipematerial_lsh where DRAWINGNO='" + DrawingNo + "' and projectid='" + ProjectNo + "'" + DTTZD + " order  by material desc ";
            //string DBConfig_sql = "Data Source=oidsnew;User ID=plm;Password=123!feed;Unicode=True";

            string sql = "";

            if (Flag == 0)
            {
                sql = "SELECT * FROM fun_pipematerial_lsh where DRAWINGNO='" + DrawingNo + "' and projectid='" + ProjectNo + "' and modifydrawingno is null  order  by material desc ";
            }
            if (Flag == 1)
            {
                sql = "SELECT * FROM fun_pipematerial_lsh where MODIFYDRAWINGNO='" + DrawingNo + "' and projectid='" + ProjectNo + "' and modifydrawingno is not  null  order  by material desc ";

            }

            DataSet ds = new DataSet();
            OracleConnection sqlCon = new OracleConnection(DataAccess.OIDSConnStr);
            OracleCommand sqlCmd = new OracleCommand(sql, sqlCon);
            OracleDataAdapter sqlAd = new OracleDataAdapter();
            sqlAd.SelectCommand = sqlCmd;
            sqlAd.Fill(ds, "sql");

                cr = new TotalPipeMaterialCR();
                cr.Load(Application.StartupPath + "CrystalReport1.rpt");
                cr.SetDataSource(ds.Tables["sql"]);
                crystalReportViewer1.ReportSource = cr;

                //传递参数
                ParameterFields paramFields = crystalReportViewer1.ParameterFieldInfo;
                ParameterField paramFrame = paramFields["drawingno"];
                ParameterValues FcurValues = paramFrame.CurrentValues;
                ParameterDiscreteValue discreteValueF = new ParameterDiscreteValue();
                discreteValueF.Value = DrawingNo;
                FcurValues.Add(discreteValueF);

                crystalReportViewer1.ParameterFieldInfo = paramFields;
                crystalReportViewer1.Refresh();
        }
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
 {
     TotalPipeMaterialCR rpt = new TotalPipeMaterialCR();
     rpt.Site = this.Site;
     return rpt;
 }