Пример #1
0
    private void ClientWiseIPVCount()
    {
        DataTable dt = new DataTable();
        DataSet   ds = new DataSet();

        //Namohar code changes on 12-Aug-2016.
        SqlParameter[] parameters = new SqlParameter[]
        {
            new SqlParameter("@dateS", DateTime.Now.ToShortDateString()),
        };

        SQlQuery = "select UserName, count(Distinct SKU_ID) as [SKU Count], CL_ClientName as Client from RTM_IPVDetails, RTM_Records, RTM_Client_List where RTM_IPVDetails.R_Id = RTM_Records.R_ID and R_Client = CL_ID and SubTask_Id='1740' and CONVERT(DATETIME, FLOOR(CONVERT(FLOAT, EndTime))) =@dateS  GROUP BY UserName, CL_ClientName";
        ds       = objDB.DSExecuteParamerizedSelectCommand(SQlQuery, CommandType.Text, parameters, "pivot");

        Pivot advPivot = new Pivot(ds.Tables["pivot"]);

        advPivot.CssTopHeading = "Heading";
        advPivot.CssLeftColumn = "LeftColumn";
        advPivot.CssSubHeading = "SubHeading";
        advPivot.CssItems      = "Items";
        advPivot.CssTotals     = "Totals";
        HtmlTable advancedPivot = advPivot.PivotTable("Client", "UserName", new string[] { "SKU Count" });

        advancedPivot.Align = "center";
        div1.Controls.Add(advancedPivot);
    }
Пример #2
0
    private void PreviousDayClientWiseIPVCount()
    {
        DataSet ds = new DataSet();

        da = new SqlDataAdapter("select UserName, count(Distinct SKU_ID) as [SKU Count], CL_ClientName as Client from RTM_IPVDetails, RTM_Records, RTM_Client_List where RTM_IPVDetails.R_Id = RTM_Records.R_ID and R_Client = CL_ID and (SubTask_Id='129' or SubTask_Id='141') and CONVERT(DATETIME, FLOOR(CONVERT(FLOAT, EndTime))) ='" + DateTime.Today.AddDays(-1).ToShortDateString() + "'  GROUP BY UserName, CL_ClientName", con);
        da.Fill(ds, "pivot");
        Pivot advPivot = new Pivot(ds.Tables["pivot"]);

        advPivot.CssTopHeading = "Heading";
        advPivot.CssLeftColumn = "LeftColumn";
        advPivot.CssSubHeading = "SubHeading";
        advPivot.CssItems      = "Items";
        advPivot.CssTotals     = "Totals";
        HtmlTable advancedPivot = advPivot.PivotTable("Client", "UserName", new string[] { "SKU Count" });

        advancedPivot.Align = "center";
        div2.Controls.Add(advancedPivot);
    }