Thursday, May 2, 2019

CONVERT COLUMN VALUES TO COMMA SEPARATED ONE ROW VALUE

--SELECT UserName,BankName,AccessType  FROM [BUDGET].[dbo].[TBLBNK_ACCESS]
drop table #temp1
SELECT UserName ,BankName,
      AccessType =
              STUFF ( ( SELECT ','+InrTab.AccessType
FROM [TBLBNK_ACCESS] InrTab

WHERE InrTab.UserName = OutTab.UserName AND  InrTab.BankName = OutTab.BankName

ORDER BY InrTab.AccessType
FOR XML PATH(''),TYPE
   ).value('.','VARCHAR(MAX)')
  , 1,1,SPACE(1)) into #temp1
FROM [TBLBNK_ACCESS] OutTab
GROUP BY OutTab.UserName , OutTab.[BankName] ;

select * from #temp1

Monday, March 11, 2019

Gridview Save as excel without dropping leading 0's (zeros) C# sap.net

 protected void Button1_Click(object sender, EventArgs e)
    {
        Response.Clear();
        Response.AddHeader("content-disposition", "attachment;filename=ForecastData.xls");
        Response.Charset = "";
        Response.Write("
");

        Response.Write("ForecastData");
        Response.Write("
");
        //Response.Write("Date:-  " + DateTime.Today.ToShortDateString());
        Response.Write("

");


        // If you want the option to open the Excel file without saving then
        // comment out the line below
        //Response.Cache.SetCacheability(HttpCacheability.No Cache);
        Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
        System.IO.StringWriter stringWrite = new System.IO.StringWriter();
        System.Web.UI.HtmlTextWriter htmlWrite = new
        HtmlTextWriter(stringWrite);
        for (int i = 0; i < GridView1.Rows.Count; i++)
        {
            GridViewRow row = GridView1.Rows[i];
            //Apply text style to each Row
            row.Attributes.Add("class", "textmode");
        }
        GridView1.RenderControl(htmlWrite);
        string style = @"";
        Response.Write(style);
        Response.ContentType = "application/text";
        Response.Write(stringWrite.ToString());
        Response.End();

    }
code by Neha

Sunday, February 24, 2019

AR Statistics History Update program

This section provides overviews of the Statistics History Update program, periodic statistical calculations, and aging information on periodic statistics, lists prerequisites, and discusses how to:

  • Run the Statistics History Update program.

  • Set processing options for Statistics History Update (R03B16A).


Wednesday, February 13, 2019