잊지 않겠습니다.

1. Using Excel COM Object

 private void ExportJoinCountToExcel(Worksheet excelworksheet)
{
    excelworksheet.Name = "가입 및 탈퇴";
    int index = 2;
    excelworksheet.Cells[1, 1] = "날짜";
    excelworksheet.Cells[1, 2] = "가입수";
    excelworksheet.Cells[1, 3] = "탈퇴수";
    foreach (GridViewRow row in gridviewJoinStatics.Rows)
    {
        excelworksheet.Cells[index, 1] = row.Cells[0].Text;
        excelworksheet.Cells[index, 2] = row.Cells[1].Text;
        excelworksheet.Cells[index, 3] = row.Cells[2].Text;
        index++;
    }
}

private void ExportPathToExcel(Worksheet excelworksheet, SyncmailPathType pathtype)
{
    GridView gridview = null;

    if(pathtype == SyncmailPathType.Join)
    {
        gridview = gridviewJoinPath;
        excelworksheet.Name = "가입 경로";
    }
    else
    {
        gridview = gridviewLeavePath;
        excelworksheet.Name = "탈퇴 경로";
    }

    excelworksheet.Cells[1, 1] = "날짜";
    List<PathCase> joinpathes = SyncmailDatabase.PathCases.GetByCase(pathtype);
    int index = 2;
    foreach (PathCase pathcase in joinpathes)
    {
        excelworksheet.Cells[1, index] = pathcase.Description;
        index++;
    }

    int rowindex = 2;
    foreach (GridViewRow row in gridview.Rows)
    {
        int columnindex = 2;
        excelworksheet.Cells[rowindex, 1] = row.Cells[0].Text;
        foreach (PathCase pathcase in joinpathes)
        {
            excelworksheet.Cells[rowindex, columnindex] = row.Cells[columnindex - 1].Text;
            columnindex++;
        }
        rowindex++;
    }
} 


2. Using Response.Output in ASP.NET

private void ExportToExcel(string strFileName, GridView dg)
{
    string attachment = string.Format("attachment; filename={0}", strFileName);
    Response.ClearContent();
    Response.AddHeader("content-disposition", attachment);
    Response.ContentType = "application/ms-excel";
    StringWriter sw = new StringWriter();
    HtmlTextWriter htw = new HtmlTextWriter(sw);
    dg.RenderControl(htw);

    string s = sw.ToString();

    Response.Write(s);
    Response.End();
}
Posted by Y2K
,

object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);

Assembly.GetExecutingAssembly().GetName().Version.ToString();
Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);

  

  • Assembly의 각각의 정보들을 얻어오고,  그 정보들을 Display 시켜주는 함수들
  • 자신의 Assembly를 얻어오는 방법에 대해서 염두해둘것!
Posted by Y2K
,

1. Preview 3/4의 uninstall.

: global에 등록되어있는 System.Web.Routing, System.Web.Mvc, System.Web.Abstractions에 대한 완벽한 uninstall이 필요하다.

: 프로그램 추가/삭제에서의 제거 뿐 아닌, Registery에서  HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Assemblies\Global에서의 완벽 제거가 필요

  

2. Namespace의 이전

: Html.ActionLink<Controller>의 Namespace가 System.Web.Mvc에서 Microsoft.Web.Mvc로 이전

  

3. RenderUserControl의 제거

RenderPartial로 함수 이름 변경

: 전에는 string을 이용한 Html의 표현 방식이였으나, 이제는 함수 형태로 변경

  

4. web.config 수정

: 버젼 정보 0.0.0.0을 모두 3.5.0.0으로 변경 

Posted by Y2K
,