コード例 #1
0
    public void ShowDetails1()
    {
        stDS = new DataSet();
        stDS = Other.Dashboard.Get_Report_SalesPerformance(0, Convert.ToInt32(DDLsuperzone.SelectedValue), Convert.ToInt32(strFY), fdate, tdate);
        if (stDS.Tables[0].Rows.Count > 0)
        {
            DataView       dv = new DataView(stDS.Tables[0]);
            ReportDocument rd = new ReportDocument();
            rd.Load(Server.MapPath("Report/SalesPerformance.rpt"));
            rd.Database.Tables[0].SetDataSource(dv);
            DataSet ds = new DataSet();

            // ds = Other.Dashboard.Get_Report_SalesPerformance_Customer1(Convert.ToInt32(stDS.Tables[0].Rows[0]["ZoneId"]), Convert.ToInt32(strFY));

            //  rd.OpenSubreport("Customer").SetDataSource(ds.Tables[0]);

            salesperformance.ReportSource = rd;

            grdnoofparty.DataBind();
            grdoutstanding.DataBind();
            GrdDiscount.DataBind();
            GrdBookset.DataBind();
            grdemployee.DataBind();
            grdcustomer.DataBind();
            grdtargetdetail.DataBind();
            // grdadddiscount.DataSource = null;
            grdadddiscount.DataBind();
        }
        else
        {
            MessageBox("No Record Found");
        }
    }
コード例 #2
0
    public void ShowDetails()
    {
        //string from = txtfromDate.Text.Split('/')[1] + "/" + txtfromDate.Text.Split('/')[0] + "/" + txtfromDate.Text.Split('/')[2];
        //string To = txtToDate.Text.Split('/')[1] + "/" + txtToDate.Text.Split('/')[0] + "/" + txtToDate.Text.Split('/')[2];
        //fdate = Convert.ToDateTime(from);
        //tdate = Convert.ToDateTime(To);
        if (fdate > tdate)
        {
            MessageBox("From Date is Greater than ToDate");
            txtfromDate.Focus();
        }
        else
        {
            DataSet ds = new DataSet();
            ds = Other.Dashboard.Get_Report_SalesPerformance(0, Convert.ToInt32(DDLsuperzone.SelectedValue), Convert.ToInt32(strFY), fdate, tdate);
            grdoutstanding.DataSource = ds.Tables[0];
            grdoutstanding.DataBind();
            grdnoofparty.DataSource = ds.Tables[0];
            grdnoofparty.DataBind();
            grdtargetdetail.DataSource = Other.Dashboard.Get_Report_SalesPerformance(0, Convert.ToInt32(DDLsuperzone.SelectedValue), Convert.ToInt32(strFY));
            grdtargetdetail.DataBind();



            GrdDiscount.DataSource = Other.Dashboard.Get_Report_SalesPerformanceForDiscountParties(Convert.ToInt32(DDLsuperzone.SelectedValue), Convert.ToInt32(strFY), fdate, tdate).Tables[0];
            GrdDiscount.DataBind();
            DataTable dt = new DataTable();
            dt = Other.Dashboard.Get_Report_SalesPerformanceForDiscountParties(Convert.ToInt32(DDLsuperzone.SelectedValue), Convert.ToInt32(strFY), fdate, tdate).Tables[1];

            //  DataTable dt = new DataTable();
            int     sum    = 0;
            DataRow newrow = dt.NewRow();
            foreach (DataColumn dc in dt.Columns)
            {
                sum = 0;
                foreach (DataRow dr in dt.Rows)
                {
                    sum += (int)dr[dc];
                }
                newrow[dc.ColumnName] = sum;
                //grdadddiscount.FooterRow.Cells.ToString()  = sum;
            }

            dt.Rows.Add(newrow);

            grdadddiscount.DataSource = dt;
            grdadddiscount.DataBind();
            //  grdadddiscount.Columns[0].Visible = false;
            GrdBookset.DataSource = Other.Dashboard.Get_Report_SalesPerformanceForBookSet(Convert.ToInt32(DDLsuperzone.SelectedValue), Convert.ToInt32(strFY), fdate, tdate);
            GrdBookset.DataBind();
            grdemployee.DataBind();
            grdcustomer.DataBind();

            lblgrdemployee.Text  = "";
            lblgrdcustomer.Text  = "";
            lblcustomername.Text = "";

            salesperformance.ReportSource = null;
        }
    }