Пример #1
0
        public void LoadReportForProjectRollup_Pipelines(string project, int rprtCase)      //*******************Added 12/8
        {
            string         currDate;
            DSForecastRprt rprtDs;

            this.Cursor = Cursors.WaitCursor;

            CRolllups ru = new CRolllups();

            rprtDs = ru.LoadReportForProjectRollup(project, rprtCase);

            currDate = DateTime.Now.ToShortDateString();
            rprtCostReport1 rprt = new rprtCostReport1();

            projNumber = project + "-RollUp";
            ViewReport(rprt);
            ViewReport(rprt);
            rprt.CutoffDate  = currDate;
            rprt.DataSource  = rprtDs;
            rprt.DataMember  = "EngrInfo";
            viewer1.Document = rprt.Document;
            rprt.IsRollup    = true;   //**********************Added 7/23/2015

            rprt.Run();

            this.Cursor = Cursors.Default;
        }
Пример #2
0
        private void LoadReportRollupforBatchPrint(string project, int rprtCase, string printer, int copy)
        {
            string currDate;

            this.Cursor = Cursors.WaitCursor;


            currDate = DateTime.Now.ToShortDateString();

            DSForecastRprt rprtDs;
            CRolllups      ru = new CRolllups();

            rprtDs = ru.LoadReportForProjectRollup(project, rprtCase);

            rprtCostReport1 rprt = new rprtCostReport1();

            rprt.Document.Printer.PrinterName            = printer;
            rprt.Document.Printer.PrinterSettings.Copies = (short)copy;
            rprt.IsRollup   = true;
            rprt.CutoffDate = currDate;
            rprt.DataSource = rprtDs;
            rprt.DataMember = "EngrInfo";
            rprt.Run();
            rprt.Document.Print(false, false);

            this.Cursor = Cursors.Default;
        }
Пример #3
0
        private void LoadReportforBatchPrint(string project, int rprtCase)
        {
            DataSet ds;

            RevSol.RSConnection cnn;
            SqlDataAdapter      da;
            SqlCommand          cmd;
            SqlParameter        prm;
            string currDate;

            this.Cursor = Cursors.WaitCursor;

            currDate = DateTime.Now.ToShortDateString();

            cnn = new RevSol.RSConnection("CR");

            if (UseNewCodes(project) == true)
            {
                cmd = new SqlCommand("spRPRT_CostReport_NewAcct2_Vision", cnn.GetConnection());
            }
            else
            {
                cmd = new SqlCommand("spRPRT_CostReport_OldAcct2_Vision", cnn.GetConnection());
            }

            cmd.CommandType = CommandType.StoredProcedure;

            prm           = cmd.Parameters.Add("@records", SqlDbType.Int); //*******Added 10/1/2015, because, it was throwing exception in PM Report
            prm.Direction = ParameterDirection.Output;

            prm       = cmd.Parameters.Add("@Project", SqlDbType.VarChar, 50);
            prm.Value = project;
            prm       = cmd.Parameters.Add("@Rprtdate", SqlDbType.SmallDateTime);
            prm.Value = currDate;
            prm       = cmd.Parameters.Add("@ReportCase", SqlDbType.Int);
            prm.Value = rprtCase;

            da = new SqlDataAdapter();
            ds = new DataSet();
            da.SelectCommand = cmd;
            da.Fill(ds);
            FtcCalculator.UpdateCalculatedField(ds);

            cnn.CloseConnection();

            rprtCostReport1 rprt = new rprtCostReport1();

            rprt.CutoffDate  = currDate;
            rprt.DataSource  = ds;
            rprt.DataMember  = "Table";
            viewer1.Document = rprt.Document;
            rprt.Run();

            this.Cursor = Cursors.Default;
        }
Пример #4
0
        public void LoadReportForDeptList(string projects, string acct)
        {
            DataSet ds;

            RevSol.RSConnection cnn;
            SqlDataAdapter      da;
            SqlCommand          cmd;
            SqlParameter        prm;
            string currDate;

            this.Cursor = Cursors.WaitCursor;

            currDate = DateTime.Now.ToShortDateString();
            cnn      = new RevSol.RSConnection("CR");

            cmd             = new SqlCommand("spRPRT_CostReport_ByDept", cnn.GetConnection());
            cmd.CommandType = CommandType.StoredProcedure;

            prm       = cmd.Parameters.Add("@ProjXml", SqlDbType.Text);
            prm.Value = projects;
            prm       = cmd.Parameters.Add("@AcctCode", SqlDbType.VarChar, 10);
            prm.Value = acct;

            da = new SqlDataAdapter();
            ds = new DataSet();
            da.SelectCommand = cmd;
            //  try
            // {

            da.Fill(ds);

            cnn.CloseConnection();

            rprtCostReport1 rprt = new rprtCostReport1();

            rprt.CutoffDate = currDate;
            rprt.NoExpenses();
            rprt.DataSource  = ds;
            rprt.DataMember  = "Table";
            viewer1.Document = rprt.Document;
            // By default rprtCostReport1.records = 0. So, when its Called for Report for Department, Detail part becomes invisible.

            rprt.records = 10;     //**********************Added 10/20/2015 *******************To Test

            rprt.Run();
            //}
            //catch {
            //    MessageBox.Show("Exception");
            //}
            this.Cursor = Cursors.Default;
        }
Пример #5
0
        private GrapeCity.ActiveReports.Document.Section.PagesCollection CreatePagesForecastForRollup(string project)
        {
            string currDate;

            this.Cursor = Cursors.WaitCursor;

            currDate = DateTime.Now.ToShortDateString();

            DSForecastRprt rprtDs;
            CRolllups      ru = new CRolllups();

            rprtDs = ru.LoadReportForProjectRollup(project, FCRMain.GetRprtCase(project));

            rprtCostReport1 rprt = new rprtCostReport1();

            rprt.CutoffDate = currDate;
            rprt.IsRollup   = true;
            rprt.DataSource = rprtDs;
            rprt.DataMember = "EngrInfo";
            rprt.Run(false);

            return(rprt.Document.Pages);
        }
Пример #6
0
        public void LoadReportForProject(string project, int rprtCase)
        {
            DataSet ds;

            RevSol.RSConnection cnn;
            SqlDataAdapter      da;
            SqlCommand          cmd;
            SqlParameter        prm;
            string currDate;
            int    record = 0; //**********************Added 7/22/2015

            this.Cursor = Cursors.WaitCursor;


            currDate = DateTime.Now.ToShortDateString();

            cnn = new RevSol.RSConnection("CR");

            if (UseNewCodes(project) == true)
            {
                cmd = new SqlCommand("spRPRT_CostReport_NewAcct2_Vision", cnn.GetConnection());
            }
            else
            {
                cmd = new SqlCommand("spRPRT_CostReport_OldAcct2_Vision", cnn.GetConnection());
            }

            cmd.CommandType = CommandType.StoredProcedure;


            prm           = cmd.Parameters.Add("@records", SqlDbType.Int);
            prm.Direction = ParameterDirection.Output;


            prm       = cmd.Parameters.Add("@Project", SqlDbType.VarChar, 50);
            prm.Value = project;
            prm       = cmd.Parameters.Add("@Rprtdate", SqlDbType.SmallDateTime);
            prm.Value = currDate;
            prm       = cmd.Parameters.Add("@ReportCase", SqlDbType.Int);
            prm.Value = rprtCase;


            //   cmd.ExecuteNonQuery();


            da = new SqlDataAdapter();
            ds = new DataSet();
            da.SelectCommand = cmd;
            da.Fill(ds);
            FtcCalculator.UpdateCalculatedField(ds);

            record = Convert.ToInt32(cmd.Parameters["@records"].Value);

            cnn.CloseConnection();

            rprtCostReport1 rprt = new rprtCostReport1();

            projNumber = project;
            // p.ViewReport(rprt);
            ViewReport(rprt);
            rprt.CutoffDate  = currDate;
            rprt.DataSource  = ds;
            rprt.DataMember  = "Table";
            viewer1.Document = rprt.Document;
            rprt.records     = record; //**********************Added 7/22/2015

            rprt.Run();
            // MessageBox.Show(record.ToString());
            //MessageBox.Show(rprt.CutoffDate.ToString());
            //MessageBox.Show(rprt.records.ToString() + "************************");
            this.Cursor = Cursors.Default;
        }