//---------------------------------------------------------------------------

#include <vcl.h>
#include "ITSSkinF.h"
#include "ITSUtilF.h"
#include "ITSDbF.h"
#include "AppGlobalF.h"
#include "WindowMsgF.h"
#include "ITSLangTransF.h"
#include "ITS_OPLibF.h"
#pragma hdrstop

#include "IHS00701F.h"

//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "FRAME_ChartF"
#pragma link "cxButtons"
#pragma link "cxCalc"
#pragma link "cxCheckBox"
#pragma link "cxClasses"
#pragma link "cxContainer"
#pragma link "cxControls"
#pragma link "cxCustomData"
#pragma link "cxData"
#pragma link "cxDataStorage"
#pragma link "cxEdit"
#pragma link "cxFilter"
#pragma link "cxGraphics"
#pragma link "cxGrid"
#pragma link "cxGridCustomTableView"
#pragma link "cxGridCustomView"
#pragma link "cxGridLevel"
#pragma link "cxGridTableView"
#pragma link "cxLabel"
#pragma link "cxLookAndFeelPainters"
#pragma link "cxLookAndFeels"
#pragma link "cxStyles"
#pragma link "cxTextEdit"
#pragma link "dxSkinBlack"
#pragma link "dxSkinBlue"
#pragma link "dxSkinsCore"
#pragma link "dxSkinscxPCPainter"
#pragma link "dxmdaset"
#pragma link "dxSkinMcSkin"
#pragma resource "*.dfm"

TIHS00701 *IHS00701 = NULL;

//---------------------------------------------------------------------------
__fastcall TIHS00701::TIHS00701(TComponent* Owner, HWND hHandle, String sFrom, String sTo, String sIdList, int AStatType)
    : TForm(Owner)
{           
    LangTrans->Translate(this, ITSDb_GetConnection());
    ITSSkin_Load(this);
    CMM_LoadForm(g_sFormsDir, this);

    FParent     = hHandle;
    FStDateTime = sFrom;
    FEdDateTime = sTo;
    FIdList     = sIdList;
    FStatType   = AStatType;

    Column04->FooterAlignmentHorz = taCenter;
#if 0
    Column05->FooterAlignmentHorz = taRightJustify;
    Column06->FooterAlignmentHorz = taRightJustify;
    Column07->FooterAlignmentHorz = taRightJustify;
    Column08->FooterAlignmentHorz = taRightJustify;
    Column09->FooterAlignmentHorz = taRightJustify;
#endif
}
//---------------------------------------------------------------------------
__fastcall TIHS00701::~TIHS00701(void)
{
}
//--------------------------------------------------------------------------

void __fastcall TIHS00701::FormInit()
{
    ADOQry->Connection = ITSDb_GetConnection();
    m_pGDC = TvList->DataController;

    TvList->OptionsView->NoDataToDisplayInfoText = FrmLang->lblNoInfo->Caption;//"<수집데이터 분석 정보>";

    LblSearch->Caption = FrmLang->lblQryCond->Caption + FStDateTime.SubString(1, 12) + " ~ " + FEdDateTime.SubString(1, 12);
}
//---------------------------------------------------------------------------

void __fastcall TIHS00701::FormShow(TObject *Sender)
{
    FormInit();
    Refresh();
    TmrShow->Enabled = true;
}
//---------------------------------------------------------------------------

void __fastcall TIHS00701::CommClose()
{
    CMM_SaveForm(g_sFormsDir, this);
    //IHS00701 = NULL;
}
//---------------------------------------------------------------------------

void __fastcall TIHS00701::TmrShowTimer(TObject *Sender)
{
    TmrShow->Enabled = false; 
    ChkExpand->Visible = false;
    Application->ProcessMessages();
    CMM_ClearGridTableView(TvList);
    try
    {
        TvList->BeginUpdate(lsimImmediate);
        SelHistory();
    }
    __finally
    {
        TvList->EndUpdate();
        ChkExpand->Visible = true;
    }
}
//---------------------------------------------------------------------------

void __fastcall TIHS00701::ChkExpandClick(TObject *Sender)
{
    CMM_ExpandCollapseChk(TvList, ChkExpand->Checked);
}
//---------------------------------------------------------------------------

void __fastcall TIHS00701::SelHistory()
{
    TSqlCursor sqlCrs;

    String sQry;
    TADOQuery *pADO = ADOQry;

    String sDateFormat;
    switch(FStatType)
    {
    case 0: //수집교통량
        FDateFormat = STR_DATETIME;
        sDateFormat = "STAT_DT AS DATES, TO_DATE(STAT_DT, 'YYYY-MM-DD HH24:MI:SS') AS DATENM, ";
        break;
    case 1: //5분교통량
    case 2: //15분 통계
        FDateFormat = STR_HHNN;
        sDateFormat = "SUBSTR(STAT_DT, 1, 12) DATES, TO_DATE(SUBSTR(STAT_DT, 1, 12), 'YYYY-MM-DD HH24:MI') AS DATENM, ";
        break;
    case 3: //시간 통계(1시간)
        FDateFormat = STR_DATEHOUR;
        sDateFormat = "SUBSTR(STAT_DT, 1, 10) DATES, TO_DATE(SUBSTR(STAT_DT, 1, 10), 'YYYY-MM-DD HH24:MI') AS DATENM, ";
        break;
    case 4: //일 통계(1일)
        FDateFormat = STR_DATE;
        sDateFormat = "SUBSTR(STAT_DT, 1, 8) DATES, TO_DATE(SUBSTR(STAT_DT, 1, 8), 'YYYY-MM-DD HH24') AS DATENM, ";
        break;
    case 5: //월 통계(1개월)
        FDateFormat = STR_MM;
        sDateFormat = "SUBSTR(STAT_DT, 1, 6) DATES, TO_DATE(SUBSTR(STAT_DT, 1, 6), 'YYYY-MM') AS DATENM, ";
        break;
    case 6: //년 통계(1년)
        FDateFormat = STR_MM;
        sDateFormat = "SUBSTR(STAT_DT, 1, 4) DATES,  TO_DATE(SUBSTR(STAT_DT, 1, 4), 'YYYY') AS DATENM, ";
        break;
    default:
        return;
    }

    String sWhere = "";
    if (FIdList.IsEmpty())
    {
        sWhere = "";
    }
    else
    {
        sWhere = " AND " + FIdList;
    }

    String sStatTable;
    switch(FStatType)
    {
    case 0: //수집교통량
        sQry = "SELECT ROAD_NAME, CROSS_NAME, DIR_NAME, " + sDateFormat + "                             \r\n"
               "       MAX(DECODE(ISTL_LANE, 1, TFVL)) AS TFVL_S,                                       \r\n"
               "       MAX(DECODE(ISTL_LANE, 2, TFVL)) AS TFVL_L,                                       \r\n"
               "       MAX(DECODE(ISTL_LANE, 3, TFVL)) AS TFVL_R,                                       \r\n"
               "       MAX(DECODE(ISTL_LANE, 4, TFVL)) AS TFVL_U,                                       \r\n"
               "       MAX(DECODE(ISTL_LANE, 1, SPED)) AS SPED_S,                                       \r\n"
               "       MAX(DECODE(ISTL_LANE, 2, SPED)) AS SPED_L,                                       \r\n"
               "       MAX(DECODE(ISTL_LANE, 3, SPED)) AS SPED_R,                                       \r\n"
               "       MAX(DECODE(ISTL_LANE, 4, SPED)) AS SPED_U                                        \r\n"
               "  FROM (SELECT B.VDS_DTCT_NMBR, B.ISTL_LANE, B.VDS_CTLR_NMBR, B.VDS_CMRA_NO,            \r\n"
               "               B.ROAD_NAME, B.CROSS_NAME, B.DIR_NAME,                                   \r\n"
               "               A.CLCT_DT AS STAT_DT, A.TFVL, A.SPED                                     \r\n"
               "          FROM TB_VDS_DTCT_CLCT A,                                                      \r\n"
               "               (SELECT A.VDS_DTCT_NMBR, A.ISTL_LANE, B.VDS_CTLR_NMBR, B.VDS_CMRA_NO,    \r\n"
               "                       B.ROAD_NAME, B.CROSS_NAME, B.DIR_NAME                            \r\n"
               "                  FROM TB_VDS_DTCT A,                                                   \r\n"
               "                       TB_VDS_CMRA B,                                                   \r\n"
               "                       TB_VDS_CTLR C                                                    \r\n"
               "                 WHERE A.DEL_YN = 'N'                                                   \r\n"
               "                   AND B.DEL_YN = 'N'                                                   \r\n"
               "                   AND C.DEL_YN = 'N'                                                   \r\n"
               "                   AND A.USE_YN = 'Y'                                                   \r\n"
               "                   AND C.VDS_TYPE_CD = 'C'                                              \r\n"
               "                   AND A.VDS_CTLR_NMBR = B.VDS_CTLR_NMBR                                \r\n"
               "                   AND A.VDS_CMRA_NO   = B.VDS_CMRA_NO                                  \r\n"
               "                   AND B.VDS_CTLR_NMBR = C.VDS_CTLR_NMBR                                \r\n"
               "                " + sWhere + "                                                          \r\n"
               "               ) B                                                                      \r\n"
               "         WHERE A.CLCT_DT BETWEEN :p01 AND :p02                                          \r\n"
               "           AND A.VDS_DTCT_NMBR = B.VDS_DTCT_NMBR                                        \r\n"
               "       )                                                                                \r\n"
               " GROUP BY ROAD_NAME, CROSS_NAME, DIR_NAME, STAT_DT                                      \r\n"
               " ORDER BY ROAD_NAME, CROSS_NAME, DIR_NAME, STAT_DT                                      \r\n";
         break;
    case 1: //5분교통량
        sQry = "SELECT ROAD_NAME, CROSS_NAME, DIR_NAME, " + sDateFormat + "                             \r\n"
               "       MAX(DECODE(ISTL_LANE, 1, TFVL)) AS TFVL_S,                                       \r\n"
               "       MAX(DECODE(ISTL_LANE, 2, TFVL)) AS TFVL_L,                                       \r\n"
               "       MAX(DECODE(ISTL_LANE, 3, TFVL)) AS TFVL_R,                                       \r\n"
               "       MAX(DECODE(ISTL_LANE, 4, TFVL)) AS TFVL_U,                                       \r\n"
               "       MAX(DECODE(ISTL_LANE, 1, SPED)) AS SPED_S,                                       \r\n"
               "       MAX(DECODE(ISTL_LANE, 2, SPED)) AS SPED_L,                                       \r\n"
               "       MAX(DECODE(ISTL_LANE, 3, SPED)) AS SPED_R,                                       \r\n"
               "       MAX(DECODE(ISTL_LANE, 4, SPED)) AS SPED_U                                        \r\n"
               "  FROM (SELECT B.VDS_DTCT_NMBR, B.ISTL_LANE, B.VDS_CTLR_NMBR, B.VDS_CMRA_NO,            \r\n"
               "               B.ROAD_NAME, B.CROSS_NAME, B.DIR_NAME,                                   \r\n"
               "               A.PRCN_DT AS STAT_DT, A.TFVL, A.SPED                                     \r\n"
               "          FROM TB_VDS_DTCT_HS A,                                                        \r\n"
               "               (SELECT A.VDS_DTCT_NMBR, A.ISTL_LANE, B.VDS_CTLR_NMBR, B.VDS_CMRA_NO,    \r\n"
               "                       B.ROAD_NAME, B.CROSS_NAME, B.DIR_NAME                            \r\n"
               "                  FROM TB_VDS_DTCT A,                                                   \r\n"
               "                       TB_VDS_CMRA B,                                                   \r\n"
               "                       TB_VDS_CTLR C                                                    \r\n"
               "                 WHERE A.DEL_YN = 'N'                                                   \r\n"
               "                   AND B.DEL_YN = 'N'                                                   \r\n"
               "                   AND C.DEL_YN = 'N'                                                   \r\n"
               "                   AND A.USE_YN = 'Y'                                                   \r\n"
               "                   AND C.VDS_TYPE_CD = 'C'                                              \r\n"
               "                   AND A.VDS_CTLR_NMBR = B.VDS_CTLR_NMBR                                \r\n"
               "                   AND A.VDS_CMRA_NO   = B.VDS_CMRA_NO                                  \r\n"
               "                   AND B.VDS_CTLR_NMBR = C.VDS_CTLR_NMBR                                \r\n"
               "                " + sWhere + "                                                          \r\n"
               "               ) B                                                                      \r\n"
               "         WHERE A.PRCN_DT BETWEEN :p01 AND :p02                                          \r\n"
               "           AND A.VDS_DTCT_NMBR = B.VDS_DTCT_NMBR                                        \r\n"
               "       )                                                                                \r\n"
               " GROUP BY ROAD_NAME, CROSS_NAME, DIR_NAME, STAT_DT                                      \r\n"
               " ORDER BY ROAD_NAME, CROSS_NAME, DIR_NAME, STAT_DT                                      \r\n";
         break;
    case 2: //15분 통계
        sStatTable  = "TB_VDS_DTCT_15M_STAT";
        FDateFormat = STR_HHNN;
        sDateFormat = "SUBSTR(STAT_DT, 1, 12) DATES, TO_DATE(SUBSTR(STAT_DT, 1, 12), 'YYYY-MM-DD HH24:MI') AS DATENM, ";
        break;
    case 3: //시간 통계(1시간)
        sStatTable  = "TB_VDS_DTCT_HH_STAT";
        FDateFormat = STR_DATEHOUR;
        sDateFormat = "SUBSTR(STAT_DT, 1, 10) DATES, TO_DATE(SUBSTR(STAT_DT, 1, 10), 'YYYY-MM-DD HH24') AS DATENM, ";
        break;
    case 4: //일 통계(1일)
        sStatTable  = "TB_VDS_DTCT_DD_STAT";
        FDateFormat = STR_DATE;
        sDateFormat = "SUBSTR(STAT_DT, 1, 8) DATES, TO_DATE(SUBSTR(STAT_DT, 1, 8), 'YYYY-MM-DD') AS DATENM, ";
        break;
    case 5: //월 통계(1개월)
        sStatTable  = "TB_VDS_DTCT_MN_STAT";
        FDateFormat = STR_MM;
        sDateFormat = "SUBSTR(STAT_DT, 1, 6) DATES, TO_DATE(SUBSTR(STAT_DT, 1, 6), 'YYYY-MM') AS DATENM, ";
        break;
    case 6: //년 통계(1년)
        sStatTable  = "TB_VDS_DTCT_YY_STAT";
        FDateFormat = STR_YY;
        sDateFormat = "SUBSTR(STAT_DT, 1, 4) DATES, TO_DATE(SUBSTR(STAT_DT, 1, 4), 'YYYY') AS DATENM, ";
        break;
    default:
        return;
    }
    switch(FStatType)
    {
    case 2: //15분 통계
    case 3: //시간 통계(1시간)
    case 4: //일 통계(1일)
    case 5: //월 통계(1개월)
    case 6: //년 통계(1년)
        sQry = "SELECT ROAD_NAME, CROSS_NAME, DIR_NAME, " + sDateFormat + "                             \r\n"
               "       MAX(DECODE(ISTL_LANE, 1, TFVL)) AS TFVL_S,                                       \r\n"
               "       MAX(DECODE(ISTL_LANE, 2, TFVL)) AS TFVL_L,                                       \r\n"
               "       MAX(DECODE(ISTL_LANE, 3, TFVL)) AS TFVL_R,                                       \r\n"
               "       MAX(DECODE(ISTL_LANE, 4, TFVL)) AS TFVL_U,                                       \r\n"
               "       MAX(DECODE(ISTL_LANE, 1, SPED)) AS SPED_S,                                       \r\n"
               "       MAX(DECODE(ISTL_LANE, 2, SPED)) AS SPED_L,                                       \r\n"
               "       MAX(DECODE(ISTL_LANE, 3, SPED)) AS SPED_R,                                       \r\n"
               "       MAX(DECODE(ISTL_LANE, 4, SPED)) AS SPED_U                                        \r\n"
               "  FROM (SELECT B.VDS_DTCT_NMBR, B.ISTL_LANE, B.VDS_CTLR_NMBR, B.VDS_CMRA_NO,            \r\n"
               "               B.ROAD_NAME, B.CROSS_NAME, B.DIR_NAME,                                   \r\n"
               "               A.STAT_DT AS STAT_DT, A.TFVL, A.AVRG_SPED AS SPED                        \r\n"
               "          FROM " + sStatTable + " A,                                                    \r\n"
               "               (SELECT A.VDS_DTCT_NMBR, A.ISTL_LANE, B.VDS_CTLR_NMBR, B.VDS_CMRA_NO,    \r\n"
               "                       B.ROAD_NAME, B.CROSS_NAME, B.DIR_NAME                            \r\n"
               "                  FROM TB_VDS_DTCT A,                                                   \r\n"
               "                       TB_VDS_CMRA B,                                                   \r\n"
               "                       TB_VDS_CTLR C                                                    \r\n"
               "                 WHERE A.DEL_YN = 'N'                                                   \r\n"
               "                   AND B.DEL_YN = 'N'                                                   \r\n"
               "                   AND C.DEL_YN = 'N'                                                   \r\n"
               "                   AND A.USE_YN = 'Y'                                                   \r\n"
               "                   AND C.VDS_TYPE_CD = 'C'                                              \r\n"
               "                   AND A.VDS_CTLR_NMBR = B.VDS_CTLR_NMBR                                \r\n"
               "                   AND A.VDS_CMRA_NO   = B.VDS_CMRA_NO                                  \r\n"
               "                   AND B.VDS_CTLR_NMBR = C.VDS_CTLR_NMBR                                \r\n"
               "                " + sWhere + "                                                          \r\n"
               "               ) B                                                                      \r\n"
               "         WHERE A.STAT_DT BETWEEN :p01 AND :p02                                          \r\n"
               "           AND A.VDS_DTCT_NMBR = B.VDS_DTCT_NMBR                                        \r\n"
               "       )                                                                                \r\n"
               " GROUP BY ROAD_NAME, CROSS_NAME, DIR_NAME, STAT_DT                                      \r\n"
               " ORDER BY ROAD_NAME, CROSS_NAME, DIR_NAME, STAT_DT                                      \r\n";
        break;
    }

    try
    {
        ITSDb_SQLText(pADO, sQry);
        ITSDb_SQLBind(pADO, "p01", FStDateTime);
        ITSDb_SQLBind(pADO, "p02", FEdDateTime);
        ITSDb_SQLOpen(pADO);

        dxMemData1->DisableControls();
        dxMemData1->Close();
        dxMemData1->CreateFieldsFromDataSet(pADO);
        dxMemData1->LoadFromDataSet(pADO);
        dxMemData1->Open();
        dxMemData1->First();
        dxMemData1->EnableControls();
        pADO->Close();

        DspHistory();
    }
    catch(EDatabaseError &E)
    {
        ::PostMessage(Application->MainForm->Handle, (UINT)(WM_USER+0xF4), (WPARAM)0xB2, (LPARAM)0xB2);
        DBERRORMSG(Caption, String(E.ClassName()), E.Message, sQry);
        throw Exception(String(E.ClassName()) + E.Message);
    }
    catch(Exception &exception)
    {
        ::PostMessage(Application->MainForm->Handle, (UINT)(WM_USER+0xF4), (WPARAM)0xB2, (LPARAM)0xB2);
        DBERRORMSG(Caption, String(exception.ClassName()), exception.Message, sQry);
        throw Exception(String(exception.ClassName()) + exception.Message);
    }
}
//---------------------------------------------------------------------------

void __fastcall TIHS00701::DspHistory()
{
    try
    {
        int nRow = 0;
        try
        {
            while(!dxMemData1->Eof)
            {
                nRow = m_pGDC->AppendRecord();

                m_pGDC->Values[nRow][Column01->Index] = dxMemData1->Fields->FieldByName("ROAD_NAME")->AsString;
                m_pGDC->Values[nRow][Column02->Index] = dxMemData1->Fields->FieldByName("CROSS_NAME")->AsString;
                m_pGDC->Values[nRow][Column03->Index] = dxMemData1->Fields->FieldByName("DIR_NAME")->AsString;
                String DATES = dxMemData1->Fields->FieldByName("DATES")->AsString;
                m_pGDC->Values[nRow][Column04->Index] = APP_FormatStr(DATES, FDateFormat);
#if 0
                m_pGDC->Values[nRow][Column05->Index] = FormatFloat("##,###", dxMemData1->Fields->FieldByName("TFVL_S")->AsInteger);
                m_pGDC->Values[nRow][Column06->Index] = FormatFloat("##,###", dxMemData1->Fields->FieldByName("TFVL_L")->AsInteger);
                m_pGDC->Values[nRow][Column07->Index] = FormatFloat("##,###", dxMemData1->Fields->FieldByName("TFVL_R")->AsInteger);
                m_pGDC->Values[nRow][Column08->Index] = FormatFloat("##,###", dxMemData1->Fields->FieldByName("TFVL_U")->AsInteger);
#else
                m_pGDC->Values[nRow][Column05->Index] = dxMemData1->Fields->FieldByName("TFVL_S")->AsInteger;
                m_pGDC->Values[nRow][Column06->Index] = dxMemData1->Fields->FieldByName("TFVL_L")->AsInteger;
                m_pGDC->Values[nRow][Column07->Index] = dxMemData1->Fields->FieldByName("TFVL_R")->AsInteger;
                m_pGDC->Values[nRow][Column08->Index] = dxMemData1->Fields->FieldByName("TFVL_U")->AsInteger;
                m_pGDC->Values[nRow][Column09->Index] = dxMemData1->Fields->FieldByName("TFVL_S")->AsInteger + dxMemData1->Fields->FieldByName("TFVL_L")->AsInteger +
                                                        dxMemData1->Fields->FieldByName("TFVL_R")->AsInteger + dxMemData1->Fields->FieldByName("TFVL_U")->AsInteger;
#endif

                dxMemData1->Next();
            }
        }
        __finally
        {
            dxMemData1->Close();

            LblRecords->Caption = FormatFloat("##,##0", m_pGDC->RecordCount) + FrmLang->lblEA->Caption;//" 건";

            String sEnd = FrmLang->lblQrySel->Caption + " [" + LblRecords->Caption + "]";//"데이터 " + LblRecords->Caption + " 이 조회 되었습니다.";
            Application->MessageBox(sEnd.c_str(),
                                    FrmLang->lblQryEnd->Caption.c_str(),//L"데이터 조회 완료",
                                    MB_OK|MB_ICONINFORMATION|MB_APPLMODAL);
        }
    }
    catch(EDatabaseError &E)
    {
        ::PostMessage(Application->MainForm->Handle, (UINT)(WM_USER+0xF4), (WPARAM)0xB2, (LPARAM)0xB2);
        //DBERRORMSG(Caption, String(E.ClassName()), E.Message, pADO->SQL->Text);
        throw Exception(String(E.ClassName()) + E.Message);
    }
    catch(Exception &e)
    {
        ::PostMessage(Application->MainForm->Handle, (UINT)(WM_USER+0xF4), (WPARAM)0xB2, (LPARAM)0xB2);
        //DBERRORMSG(Caption, String(e.ClassName()), e.Message, pADO->SQL->Text);
        throw Exception(String(e.ClassName()) + e.Message);
    }
}
//---------------------------------------------------------------------------

void __fastcall TIHS00701::OnMessage(TMessage &Msg)
{
    switch (Msg.Msg)
    {
    case WM_PARAM_DATABASE:
        if (WP_DB_SELECT_OK == Msg.WParam)
        {
            //ShowMessage("Select Ok");
        }
        break;
    }
}
//---------------------------------------------------------------------------

void __fastcall TIHS00701::BtnExlSaveClick(TObject *Sender)
{
    TcxGrid          *pGrid = CxList;
    TcxGridTableView *pView = TvList;
    String            sTitle= Caption;//"수집데이터분석";

    CMM_ExportToExcelFile(sTitle, pGrid, pView, this);
}
//---------------------------------------------------------------------------

void __fastcall TIHS00701::FormClose(TObject *Sender, TCloseAction &Action)
{
    POST_MSG(FParent, WM_SUBFORM_CLOSE, 0, 0);
    CommClose();
    //IHS00701 = NULL;
}
//---------------------------------------------------------------------------

void __fastcall TIHS00701::FormDestroy(TObject *Sender)
{
    CommClose();
}
//---------------------------------------------------------------------------

void __fastcall TIHS00701::TvListTcxGridDataControllerTcxDataSummaryFooterSummaryItems4GetText(TcxDataSummaryItem *Sender,
          const Variant &AValue, bool AIsFooter, UnicodeString &AText)
{
    AText = "합계";
}
//---------------------------------------------------------------------------

void __fastcall TIHS00701::TvListTcxGridDataControllerTcxDataSummaryDefaultGroupSummaryItems10GetText(TcxDataSummaryItem *Sender,
          const Variant &AValue, bool AIsFooter, UnicodeString &AText)
{
    AText = "소계";
}
//---------------------------------------------------------------------------

