/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package ExcelReportController;

import DataEntryBean.ExcelReportBean;
import java.util.ArrayList;

/**
 *
 * @author Tcs Helpdesk10
 */
public class ExcelReportInformation {

    private String reportName;
    private String reportQuery;
    private ArrayList reportHeader;
    public int TYPE_STRING = 1;
    public int TYPE_BIG_DECIMAL = 2;

    public ExcelReportInformation(String sReportName) {

        this.reportName = sReportName;
    }

// Here provide the required query for the Report
    public String getReportQuery() {

        StringBuffer queryBuffer = new StringBuffer();
        if (reportName.equalsIgnoreCase("BULK_TRANSACTION_REPORT")) {

            queryBuffer.append("  select rownum as SL_NO, d.dccb_name as DCCB_NAME, d.sb_acc_no as SAVINGS_ACCOUNT_NO,d.cif_no as CIF_NO,d.prod_code as PRODUCT_CODE,d.intt_cat as INTEREST_CATEGORY, \n");
            //  queryBuffer.append("  (p.first_name||nvl2(p.middle_name,' '||p.middle_name,'')||nvl2(p.last_name,' '||p.last_name,'')) as CUSTOMER_NAME,\n");
            queryBuffer.append("  to_char(d.txn_post_date, 'DD-MON-YYYY') as TRANSACTION_POSTING_DATE,\n");
            queryBuffer.append("   d.jrnl_no as JOURNAL_NO,\n");
            queryBuffer.append("  (case d.txn_ind\n"
                    + "         when 'DR' then\n"
                    + "          'KCC-Disbursement'\n"
                    + "         when 'CR' then\n"
                    + "          'KCC-Repayment'\n"
                    + "       end) as TRANSACTION_TYPE,\n");
            queryBuffer.append("  d.txn_amt as TRANSACTION_AMOUNT,d.comments as COMMENTS \n");
            queryBuffer.append("    from bulk_txn_post d \n");

            //queryBuffer.append("    where p.linked_sb_accno=d.sb_acc_no \n");
            //queryBuffer.append("  and a.customer_no=p.cif_no \n");
            // queryBuffer.append("   and a.link_accno=d.sb_acc_no \n");
            queryBuffer.append("  where d.post_flag='Y' \n");

            reportQuery = queryBuffer.toString();

        } else if (reportName.equalsIgnoreCase("EOD_INTT_COMPUTATION_REPORT")) {

            queryBuffer.append("  select rownum  as SL_NO ,e.activity as ACTIVITY,a.pacs_id as PACS_ID, e.account_no as ACCOUNT_NO,e.errordesc as REMARKS,e.sys_date as TRANSACTION_DATE  \n");
            queryBuffer.append("    from eod_log e, dep_account a \n");
            queryBuffer.append("    where a.key_1=e.account_no \n");

            reportQuery = queryBuffer.toString();

        } else if (reportName.equalsIgnoreCase("BULK_KYC_REPORT")) {

            queryBuffer.append("  select rownum as SL_NO, t.bank_name as BANK_NAME,t.cbs_br_code as CBS_BR_CODE, t.cif_no as CIF_NO,  \n");
            queryBuffer.append("    t.customer_type as CUSTOMER_TYPE,t.linked_sb_accno as LINKED_SB_ACCNO,t.title as TITLE, \n");
            queryBuffer.append("    t.first_name as FIRST_NAME,t.middle_name as MIDDLE_NAME,t.last_name as LAST_NAME, t.guardian_name as GUARDIAN_NAME, \n");
            queryBuffer.append("    t.address_1 as ADDRESS_1,t.address_2 as ADDRESS_2,t.address_3 as ADDRESS_3, \n");
            queryBuffer.append("    t.district as DISTRICT,t.city as CITY,t.state as STATE,t.birth_date as BIRTH_DATE, \n");
            queryBuffer.append("    t.gender as GENDER,t.mobile_no as MOBILE_NO,t.id_type as ID_TYPE, \n");
            queryBuffer.append("    t.id_no as ID_NO,t.id_issue_date as ID_ISSUE_DATE,t.id_issued_at as ID_ISSUED_AT,t.post_date as POST_DATE,t.comments as COMMENTS \n");
            queryBuffer.append("    from bulk_kyc t \n");

            reportQuery = queryBuffer.toString();

        }

        return reportQuery;
    }

    public String getReportQuery(ExcelReportBean Bean, String pacsId, String subPacsFlag) {

        StringBuffer queryBuffer = new StringBuffer();
        String accountNo = "";
        String product = "";
        String fromDate = "";
        String toDate = "";
        String fromAmount = "";
        String toAmount = "";
        String linkedSbAccount = "";
        String loanRepYYYYMM = "";
        String cifNumber = "";
        String tranRefSearch = "";
        String srchByCIF = "";
        String subpacs_id = "";
        String enqTypeSearch = "";
        String oldAccNo = "";
        String oldCifNo = "";
        String modOfAcc = "";
        String productID;

        accountNo = (Bean.getAccountNo() == null) ? "" : Bean.getAccountNo();
        product = (Bean.getProductName() == null) ? "" : Bean.getProductName();
        fromDate = (Bean.getFromDate() == null) ? "" : Bean.getFromDate();
        toDate = (Bean.getToDate() == null) ? "" : Bean.getToDate();
        fromAmount = (Bean.getFromAmount() == null) ? "" : Bean.getFromAmount();
        toAmount = (Bean.getToAmount() == null) ? "" : Bean.getToAmount();
        linkedSbAccount = (Bean.getLinkedSbAccount() == null) ? "" : Bean.getLinkedSbAccount();
        loanRepYYYYMM = (Bean.getLoanRepYYYYMM() == null) ? "" : Bean.getLoanRepYYYYMM();
        cifNumber = (Bean.getCifNumber() == null) ? "" : Bean.getCifNumber();
        tranRefSearch = (Bean.getTranRefSearch() == null) ? "" : Bean.getTranRefSearch();
        srchByCIF = (Bean.getSrchByCIF() == null) ? "" : Bean.getSrchByCIF();
        subpacs_id = (Bean.getSubpacs_id() == null) ? "" : Bean.getSubpacs_id();
        enqTypeSearch = (Bean.getEnqTypeSearch() == null) ? "" : Bean.getEnqTypeSearch();
        oldAccNo = (Bean.getOldAccNo() == null) ? "" : Bean.getOldAccNo();
        oldCifNo = (Bean.getOldCifNo() == null) ? "" : Bean.getOldCifNo();
        productID = (Bean.getProductID() == null) ? "" : Bean.getProductID();
        modOfAcc = (Bean.getModOfAcc() == null ) ? "" : Bean.getModOfAcc();

        if (reportName.equalsIgnoreCase("ACCOUNT_ENQUIRY_REPORT")) {

            queryBuffer.append("  select rownum as SL_NO, KEY_1 as ACCOUNT_NO, to_char(ACCT_OPEN_DT,'DD-MON-YYYY') as ACCT_OPEN_DT,a.link_accno as LINKED_CBS_ACCOUNT_NO, AVAIL_BAL,  \n");
            queryBuffer.append("    a.CUSTOMER_NO as CUSTOMER_NO,a.SANCTION_AMT as SANCTION_AMT ,decode(a.CURR_STATUS,'C','Closed','D','Dormant','S','Stopped','I','Initiated','M','Matured','Open/Active') as CURR_STATUS ,a.PRIN_OUTST as PRIN_OUTST ,a.INTT_OUTST as INTT_OUTST,a.PENAL_INTT_PAID as PENAL_INTT_PAID, \n");
            queryBuffer.append("    (t.first_name||nvl2(t.middle_name,' '||t.middle_name,'')||nvl2(t.last_name,' '||t.last_name,'')) as CUST_NAME, \n");
            queryBuffer.append("    p.prod_name as PRODUCT_NAME,to_char(a.limit_exp_date,'DD-MON-YYYY') as LIMIT_EXPIRY_DATE,a.PRIN_PAID as PRINCIPAL_PAID,a.INTT_PAID as INTEREST_PAID,a.PENAL_INTT_OUTST as PENAL_INTT_OUTSTANDING,a.OLD_ACCNO as OLD_ACCOUNT_NUMBER,a.OLD_CIF as OLD_CIF_NUMBER \n");
            queryBuffer.append("     from dep_product p,dep_account a, kyc_details t  \n");
            queryBuffer.append("    where a.dep_prod_id=p.id and t.cif_no =a.customer_no and to_number(substr(p.prod_code, 1, 1)) > 5 and a.pacs_id='" + pacsId + "' \n");

            if (!accountNo.equalsIgnoreCase("")) {
                queryBuffer.append("    and  a.key_1='" + Bean.getAccountNo() + "' \n");
            }

            if ((!fromDate.equalsIgnoreCase("")) && (!toDate.equalsIgnoreCase(""))) {

                queryBuffer.append("    and  a.ACCT_OPEN_DT between to_date ('" + Bean.getFromDate() + "','dd/mm/yyyy') \n");
                queryBuffer.append("   and to_date ('" + Bean.getToDate() + "','dd/mm/yyyy') \n");
            }

            if (!product.equalsIgnoreCase("")) {
                queryBuffer.append("    and dep_prod_id='" + Bean.getProductName() + "' \n");
            }

            if ((!fromAmount.equalsIgnoreCase("")) && (!toAmount.equalsIgnoreCase(""))) {
                queryBuffer.append("    and a.AVAIL_BAL between='" + Bean.getFromAmount() + "' \n");
                queryBuffer.append("    and '" + Bean.getToAmount() + "' \n");
            }

            if (!linkedSbAccount.equalsIgnoreCase("")) {
                queryBuffer.append("    and link_accno='" + Bean.getLinkedSbAccount() + "' \n");
            }

            reportQuery = queryBuffer.toString();

        } else if (reportName.equalsIgnoreCase("TRANSACTION_ENQUIRY_REPORT")) {

            queryBuffer.append("  select rownum as SL_NO, a.key_1 as ACCOUNT_NO,a.link_accno as LINKED_CBS_ACCOUNT_NO,d.cbs_ref_no as CBS_REF_NO,to_char(d.tran_date,'DD-MON-YYYY') AS TRAN_DATE, \n");
            queryBuffer.append("    (case d.tran_ind\n"
                    + "                             when 'DR' then 'KCC-Disbursement'\n"
                    + "                             when 'CR' then 'KCC-Repayment'\n"
                    + "                        end)  as TXN_TYPE,d.txn_amt as TXN_AMT,to_char(a.LIMIT_EXP_DATE,'dd-MON-yyyy') as LIMIT_EXPIRY_DATE,p.PROD_NAME as PRODUCT_NAME,d.END_BAL as END_BALANCE \n");

            queryBuffer.append(" from dep_txn d,dep_account a, dep_product p \n");
            queryBuffer.append(" where d.acct_no=a.key_1\n"
                    + "                        and a.dep_prod_id=p.id and a.pacs_id='" + pacsId + "' \n");

            if (!accountNo.equalsIgnoreCase("")) {
                queryBuffer.append("    and  a.key_1='" + Bean.getAccountNo() + "' \n");
            }

            if ((!fromDate.equalsIgnoreCase("")) && (!toDate.equalsIgnoreCase(""))) {

                queryBuffer.append("    and  d.tran_date between  to_date ('" + Bean.getFromDate() + "','dd/mm/yyyy') \n");
                queryBuffer.append("   and to_date ('" + Bean.getToDate() + "','dd/mm/yyyy') \n");
            }

            if (!product.equalsIgnoreCase("")) {
                queryBuffer.append("    and a.dep_prod_id='" + Bean.getProductName() + "' \n");
            }

            if ((!fromAmount.equalsIgnoreCase("")) && (!toAmount.equalsIgnoreCase(""))) {
                queryBuffer.append("    and d.txn_amt between='" + Bean.getFromAmount() + "' \n");
                queryBuffer.append("    and '" + Bean.getToAmount() + "' \n");
            }

            if (!linkedSbAccount.equalsIgnoreCase("")) {
                queryBuffer.append("    and link_accno='" + Bean.getLinkedSbAccount() + "' \n");
            }

            reportQuery = queryBuffer.toString();

        } else if (reportName.equalsIgnoreCase("GL_ACCOUNT_ENQUIRY_REPORT")) {

            queryBuffer.append("  select rownum as SL_NO, KEY_1 as GL_ACCOUNT_NO, LEDGER_NAME as LEDGER_NAME, to_char(acct_open_date,'DD-MON-YYYY') as GL_ACCT_OPEN_DT, cum_curr_val as CURRENT_BALANCE,  \n");
            queryBuffer.append("    decode(a.status,'A','ACTIVE','INACTIVE') as STATUS, gl_code as GL_CODE, \n");
            queryBuffer.append("    gl_name as GL_NAME from GL_product p,GL_account a where a.GL_prod_id=p.id \n");


            if (subPacsFlag.equalsIgnoreCase("N")) {

                if (!subpacs_id.equalsIgnoreCase("")) {

                    queryBuffer.append("and a.pacs_id= '" + subpacs_id + "'   \n");

                } else if (subpacs_id.equalsIgnoreCase("")) {

                    queryBuffer.append("and a.pacs_id in (select pacs.pacs_id from pacs_master pacs where pacs.head_pacs_id='" + pacsId + "') \n");

                }

            } else if (subPacsFlag.equalsIgnoreCase("Y")) {

                queryBuffer.append("and a.pacs_id= '" + pacsId + "'   \n");

            }


            if (!accountNo.equalsIgnoreCase("")) {
                queryBuffer.append("    and  a.key_1='" + Bean.getAccountNo() + "' \n");
            }

            if ((!fromDate.equalsIgnoreCase("")) && (!toDate.equalsIgnoreCase(""))) {

                queryBuffer.append("    and  a.ACCT_OPEN_DT between to_date ('" + Bean.getFromDate() + "','dd/mm/yyyy') \n");
                queryBuffer.append("   and to_date ('" + Bean.getToDate() + "','dd/mm/yyyy') \n");
            }

            if (!product.equalsIgnoreCase("")) {
                queryBuffer.append("    and a.gl_prod_id='" + Bean.getProductName() + "' \n");
            }

            if ((!fromAmount.equalsIgnoreCase("")) && (!toAmount.equalsIgnoreCase(""))) {
                queryBuffer.append("    and a.cum_curr_val between='" + Bean.getFromAmount() + "' \n");
                queryBuffer.append("    and '" + Bean.getToAmount() + "' \n");
            }
            reportQuery = queryBuffer.toString();
            System.out.println(queryBuffer.toString());

        } else if (reportName.equalsIgnoreCase("GL_TRANSACTION_ENQUIRY_REPORT")) {

            queryBuffer.append("  select rownum as SL_NO, a.key_1 as GL_ACCOUNT_NO,p.gl_name as GL_CODE,g.cbs_ref_no as CBS_REF_NO,to_char(g.tran_date,'DD-MON-YYYY') as TRAN_DATE,g.jrnl_no as JRNL_NO,  \n");
            queryBuffer.append("    (case g.tran_ind \n"
                    + "                             when 'DR' then 'GL-DEBIT'\n"
                    + "                             when 'CR' then 'GL-CREDIT'\n"
                    + "                        end) as TXN_TYPE,g.txn_amt as TXN_AMT,g.narration as TRANSACTION_NARRATION \n");

            queryBuffer.append(" from gl_txn g,gl_account a, gl_product p \n");
            queryBuffer.append(" where g.acct_no=a.key_1 \n"
                    + "                        and a.gl_prod_id=p.id \n");


            if (subPacsFlag.equalsIgnoreCase("N")) {
                if (!subpacs_id.equalsIgnoreCase("")) {

                    queryBuffer.append("and a.pacs_id= '" + subpacs_id + "'   \n");

                } else if (subpacs_id.equalsIgnoreCase("")) {

                    queryBuffer.append("and a.pacs_id in (select pacsm.pacs_id from pacs_master pacsm where  pacsm.head_pacs_id =(select pacs.head_pacs_id from pacs_master pacs where pacs.pacs_id = '" + pacsId + "'))");
                }
            } else if (subPacsFlag.equalsIgnoreCase("Y")) {
                queryBuffer.append("and a.pacs_id= '" + pacsId + "'   \n");
            }


            if (!accountNo.equalsIgnoreCase("")) {
                queryBuffer.append("    and  a.key_1='" + Bean.getAccountNo() + "' \n");
            }

            if ((!fromDate.equalsIgnoreCase("")) && (!toDate.equalsIgnoreCase(""))) {

                queryBuffer.append("    and  g.tran_date between  to_date ('" + Bean.getFromDate() + "','dd/mm/yyyy') \n");
                queryBuffer.append("   and to_date ('" + Bean.getToDate() + "','dd/mm/yyyy') \n");
            }

            if (!product.equalsIgnoreCase("")) {
                queryBuffer.append("    and a.gl_prod_id='" + Bean.getProductName() + "' \n");
            }

            if ((!fromAmount.equalsIgnoreCase("")) && (!toAmount.equalsIgnoreCase(""))) {
                queryBuffer.append("    and  g.txn_amt between='" + Bean.getFromAmount() + "' \n");
                queryBuffer.append("    and '" + Bean.getToAmount() + "' \n");
            }



            if (!tranRefSearch.equalsIgnoreCase("")) {
                queryBuffer.append("    and  g.cbs_ref_no='" + Bean.getTranRefSearch() + "' \n");
            }

            reportQuery = queryBuffer.toString();
            System.out.println(queryBuffer.toString());

        } else if (reportName.equalsIgnoreCase("DEP_TXN_ENQ_REPORT")) {

            queryBuffer.append("  select rownum as SL_NO, a.key_1 as ACCOUNT_NO,d.cbs_ref_no as CBS_REF_NO,to_char(d.tran_date,'DD-MON-YYYY') AS TRAN_DATE, \n");
            queryBuffer.append("    (case d.tran_ind\n"
                    + "                             when 'DR' then 'DEPOSIT-Debit'\n"
                    + "                             when 'CR' then 'DEPOSIT-Credit'\n"
                    + "                        end)  as TXN_TYPE,d.txn_amt as TXN_AMT,p.PROD_NAME as PRODUCT_NAME,p.INTT_CAT_DESC as INTT_DESCRIPTION,d.END_BAL as END_BALANCE, d.NARRATION  \n");

            queryBuffer.append(" from dep_txn d,dep_account a, dep_product p \n");
            queryBuffer.append(" where d.acct_no=a.key_1\n"
                    + "                        and a.dep_prod_id=p.id and func_getAccountType(a.KEY_1) in ('1','2','5','3') \n");


            if (subPacsFlag.equalsIgnoreCase("N")) {
                if (!subpacs_id.equalsIgnoreCase("")) {

                    queryBuffer.append("and a.pacs_id= '" + subpacs_id + "'   \n");

                } else if (subpacs_id.equalsIgnoreCase("")) {

                    queryBuffer.append("and a.pacs_id in (select pacsm.pacs_id from pacs_master pacsm where  pacsm.head_pacs_id =(select pacs.head_pacs_id from pacs_master pacs where pacs.pacs_id = '" + pacsId + "'))");
                }
            } else if (subPacsFlag.equalsIgnoreCase("Y")) {
                queryBuffer.append("and a.pacs_id= '" + pacsId + "'   \n");
            }


            if (!accountNo.equalsIgnoreCase("")) {
                queryBuffer.append("    and  a.key_1='" + Bean.getAccountNo() + "' \n");
            }

            if ((!fromDate.equalsIgnoreCase("")) && (!toDate.equalsIgnoreCase(""))) {

                queryBuffer.append("    and  d.tran_date between  to_date ('" + Bean.getFromDate() + "','dd/mm/yyyy') \n");
                queryBuffer.append("   and to_date ('" + Bean.getToDate() + "','dd/mm/yyyy') \n");
            }

            if (!product.equalsIgnoreCase("")) {
                queryBuffer.append("    and a.dep_prod_id='" + Bean.getProductName() + "' \n");
            }

            if ((!fromAmount.equalsIgnoreCase("")) && (!toAmount.equalsIgnoreCase(""))) {
                queryBuffer.append("    and d.txn_amt between '" + Bean.getFromAmount() + "' \n");
                queryBuffer.append("    and '" + Bean.getToAmount() + "' \n");
            }
            if (!tranRefSearch.equalsIgnoreCase("")) {
                queryBuffer.append("    and  d.cbs_ref_no='" + Bean.getTranRefSearch() + "' \n");
            }

            System.out.println(queryBuffer.toString());
            reportQuery = queryBuffer.toString();


        } else if (reportName.equalsIgnoreCase("LOAN_REPAYMENT_SCHEDULE_REPORT")) {

            queryBuffer.append("select s.install_no as INSTALL_NO, a.key_1 as LOAN_ACCOUNT_NO,s.repay_yyyymm as REPAY_YYYYMM,s.emi_amt as EMI_AMOUNT,s.prin_amt as PRINCIPAL_AMOUNT,s.intt_amt as INTEREST_AMOUNT,s.prin_outst as PRINCIPAL_OUTSTANDING, \n");
            queryBuffer.append("    (case when s.install_no=1 then a.sanction_amt else (s.prin_outst+s.PRIN_AMT) end) as OPENING_BALANCE,\n"
                    + "  s.prin_outst as CLOSING_BALANCE \n");

            queryBuffer.append(" from loan_repay_schedule s,loan_account a \n");
            queryBuffer.append(" where a.pacs_id='" + pacsId + "' and a.key_1=s.accno \n");

            if (!accountNo.equalsIgnoreCase("")) {
                queryBuffer.append("    and  s.accno ='" + Bean.getAccountNo() + "' \n");
            }



            if (!loanRepYYYYMM.equalsIgnoreCase("")) {
                queryBuffer.append("    and  s.repay_yyyymm >='" + Bean.getLoanRepYYYYMM() + "' \n");
            }

            queryBuffer.append(" order by 3 \n");


            reportQuery = queryBuffer.toString();

        } else if (reportName.equalsIgnoreCase("LOAN_ACCOUNT_ENQUIRY_REPORT")) {

            queryBuffer.append("  select * from (select l.key_1 LOAN_ACCOUNT_NO,(t.first_name||' '||nvl2(t.middle_name,''||t.middle_name,'')||nvl2(t.last_name,''||t.last_name,'')) CUSTOMER_NAME,l.customer_no as CUSTOMER_NO,l.sanction_amt as SANCTIONED_AMOUNT,to_char(l.sanc_dt,'DD-MON-YYYY') as SANCTIONED_DATE,decode(l.CURR_STATUS, '04', 'Closed', '03', 'Fully Disbursed', '02', 'Partially Disbursed', '01', 'Initiated', 'Fully Disbursed') as CURR_STATUS,l.disb_amt as AMOUNT_DISBURSED,l.intt_outst as INTT_OUTSTD,l.prin_outst as PRIN_OUTSTD,l.intt_paid as INTT_PAID,l.prin_paid as PRIN_PAID,(case when l.emi =0 then 'NA' else to_char(l.emi) end) as EMI_AMOUNT, to_char(l.due_dt,'DD-MON-YYYY') as NEXT_DUE_DATE,l.lst_txn_dt as LAST_REPAYMENT_DATE, p.intt_cat_desc as INTEREST_CATEGORY, p.PROD_NAME as PRODUCT_NAME,(l.intt_outst+l.npa_intt_outst+l.penal_intt_outst) as TOTAL_INTT_OUTST, (l.intt_accr+l.penal_intt_accr+l.npa_intt_accr) as TOTAL_INTT_ACCR, (l.intt_paid+l.penal_intt_paid+l.npa_intt_paid) as TOTAL_INTT_PAID, decode(p.LOAN_TYPE,'E','EMI','N','Negotiable','C','Cash Credit') as LOAN_TYPE, l.old_accno as OLD_ACCOUNT_NUMBER,M.intt_rate as INTEREST_RATE,rownum SL_NO \n");

            queryBuffer.append(" from loan_account l,loan_product p,kyc_hdr t, loan_interest_map M \n");
            queryBuffer.append(" where l.customer_no = t.cif_no and l.loan_prod_id=p.id and M.key_1 = l.key_1 \n");


            if (subPacsFlag.equalsIgnoreCase("N")) {
                if (!subpacs_id.equalsIgnoreCase("")) {

                    queryBuffer.append("and l.pacs_id= '" + subpacs_id + "'   \n");

                } else if (subpacs_id.equalsIgnoreCase("")) {

                    queryBuffer.append("and l.pacs_id in (select pacsm.pacs_id from pacs_master pacsm where  pacsm.head_pacs_id =(select pacs.head_pacs_id from pacs_master pacs where pacs.pacs_id = '" + pacsId + "'))");
                }
            } else if (subPacsFlag.equalsIgnoreCase("Y")) {
                queryBuffer.append("and l.pacs_id= '" + pacsId + "'   \n");
            }

            if (!accountNo.equalsIgnoreCase("")) {
                queryBuffer.append("    and  l.key_1 = '" + Bean.getAccountNo() + "' \n");
            }

            if (!oldAccNo.equalsIgnoreCase("")) {
                queryBuffer.append("    and  l.old_accno = '" + Bean.getOldAccNo() + "' \n");
            }

            if (!oldCifNo.equalsIgnoreCase("")) {
                queryBuffer.append("    and  l.old_cif = '" + Bean.getOldCifNo() + "' \n");
            }

            if (!productID.equalsIgnoreCase("")) {
                queryBuffer.append("    and  p.id = '" + Bean.getProductID() + "' \n");
            }

            if ((!fromDate.equalsIgnoreCase("")) && (!toDate.equalsIgnoreCase(""))) {

                queryBuffer.append("    and  l.sanc_dt between  to_date ('" + Bean.getFromDate() + "','dd/mm/yyyy') \n");
                queryBuffer.append("   and to_date ('" + Bean.getToDate() + "','dd/mm/yyyy') \n");
            }

            if (!cifNumber.equalsIgnoreCase("")) {
                queryBuffer.append("    and l.customer_no='" + Bean.getCifNumber() + "' \n");
            }



            queryBuffer.append(")");

            reportQuery = queryBuffer.toString();

            System.out.println(queryBuffer.toString());

        } else if (reportName.equalsIgnoreCase("DEPOSIT_ACCOUNT_ENQUIRY_REPORT")) {


            queryBuffer.append("  select * from (select KEY_1 as ACCOUNT_NO, to_char(ACCT_OPEN_DT,'DD-MON-YYYY') ACCT_OPEN_DT, AVAIL_BAL as AVAILABLE_BALANCE, AVAIL_BAL_KIND,a.CUSTOMER_NO as CUSTOMER_NO,(t.first_name||nvl2(t.middle_name,' '||t.middle_name,'')||nvl2(t.last_name,' '||t.last_name,'')) CUST_NAME,   \n");
            queryBuffer.append("p.prod_name as PROD_NAME,(select nvl(sum(m.operation_value),0) from dep_miscl_operation m where m.account_no=a.key_1 and m.status = 'Y'            and m.ACTION_CODE = 'HOLD') as HOLD_VALUE,(case when substr(p.prod_code,1,1) in ('2','3') then a.TD_INTT_RATE else (select (case  when a.avail_bal >= s.threshold_bal then s.intt_rate when a.avail_bal <s.threshold_bal then s.threshold_intt_rate end) from sb_prod_map s where s.id=p.id and s.pacs_id=a.pacs_id ) end)as INTT_RATE,decode(a.CURR_STATUS,'C','Closed','D','Dormant','S','Stopped','I','Initiated','M','Matured','Open/Active') as CURR_STATUS,a.intt_outst as INTT_AVAILABLE,to_char(a.intt_eop_date,'dd-Mon-yyyy') as INTT_EOP_DATE,to_char(a.intt_sop_date,'dd-Mon-yyyy') as INTT_SOP_DATE,DECODE(a.term_value, NULL, 'NA', a.term_value) as TERM_VALUE ,DECODE(a.mat_value, NULL, 'NA', a.mat_value) as MATURITY_VALUE,DECODE(a.mat_dt, NULL, 'NA', to_char(a.mat_dt,'dd-Mon-YYYY')) as MATURITY_DATE,(case when p.prod_code like '1%' then 'NA' else to_char(a.term_from_dt, 'dd/mm/yyyy') end) as TERM_FROM_DATE,  (case when p.prod_code like '1%'  then 'NA' else to_char(a.term_to_dt, 'dd/mm/yyyy') end) as TERM_TO_DATE,DECODE(a.intt_projected, NULL, 'NA', a.intt_projected) as INTT_PROJECTED,a.INTT_CAP_AMT as CAPITALIZED_INTEREST,(case when substr(p.prod_code,1,1) in ('3') then to_char(a.INSTALL_AMT) else 'NA' end)as INSTALL_AMT,(case when substr(p.prod_code,1,1) in ('3') then to_char(a.NO_INST_PAID) else 'NA' end)as NO_INST_PAID,(case when substr(p.prod_code,1,1) in ('3') then to_char(a.NXT_DUE_DATE,'DD-Mon-YYYY') else 'NA' end)as NXT_DUE_DATE, (case when substr(p.prod_code,1,1)='2' then a.term_length || ' Days'  when substr(p.prod_code,1,1)='3' then a.term_length || ' Months' else 'NA' end) as TERM_LENGTH,             (case when a.intt_repay_method ='T' then 'Transfer to ' || a.int_trf_accno                  when a.intt_repay_method ='F' then 'Freeze' when a.intt_repay_method ='R' then 'Auto-Renew'  else 'NA' end) as INT_REPAY_METHOD, a.old_accno as OLD_ACCOUNT_NUMBER, rownum SL_NO, nvl((select dap.mop_name from acc_mop_map dap where dap.mop_code = a.mop ),'NA') as MODE_OF_ACC  , a.link_accno as LINKED_CBS_ACCOUNT_NO \n");



            queryBuffer.append(" from dep_product p,dep_account a, kyc_hdr t  \n");
            queryBuffer.append(" where a.dep_prod_id=p.id and t.cif_no = a.customer_no "
                    + " and to_number(func_getAccountType(a.KEY_1)) < 6 \n");

            if (subPacsFlag.equalsIgnoreCase("N")) {

                if (!subpacs_id.equalsIgnoreCase("")) {

                    queryBuffer.append("and a.pacs_id= '" + subpacs_id + "'   \n");

                } else if (subpacs_id.equalsIgnoreCase("")) {

                    queryBuffer.append("and a.pacs_id in (select pacs.pacs_id from pacs_master pacs where pacs.head_pacs_id='" + pacsId + "') \n");

                }

            } else if (subPacsFlag.equalsIgnoreCase("Y")) {

                queryBuffer.append("and a.pacs_id= '" + pacsId + "'   \n");

            }

            if (!accountNo.equalsIgnoreCase("")) {
                queryBuffer.append("    and  a.key_1 = '" + Bean.getAccountNo() + "' \n");
            }
            if (!oldAccNo.equalsIgnoreCase("")) {
                queryBuffer.append("    and  a.old_accno = '" + Bean.getOldAccNo() + "' \n");
            }
            if (!oldCifNo.equalsIgnoreCase("")) {
                queryBuffer.append("    and  a.old_cif = '" + Bean.getOldCifNo() + "' \n");
            }
            if ((!fromDate.equalsIgnoreCase("")) && (!toDate.equalsIgnoreCase(""))) {

                queryBuffer.append("    and  d.tran_date between  to_date ('" + Bean.getFromDate() + "','dd/mm/yyyy') \n");
                queryBuffer.append("   and to_date ('" + Bean.getToDate() + "','dd/mm/yyyy') \n");
            }

            if (!product.equalsIgnoreCase("")) {
                queryBuffer.append("    and a.dep_prod_id='" + Bean.getProductName() + "' \n");
            }

            if ((!fromAmount.equalsIgnoreCase("")) && (!toAmount.equalsIgnoreCase(""))) {
                queryBuffer.append("    and a.avail_bal between '" + Bean.getFromAmount() + "' \n");
                queryBuffer.append("    and '" + Bean.getToAmount() + "' \n");
            }

            if (modOfAcc.equalsIgnoreCase("S")) {
                queryBuffer.append("    and  a.cif_no2 is null  \n");
            }

            if (modOfAcc.equalsIgnoreCase("J")) {
                queryBuffer.append("    and  a.cif_no2 is not null \n");
            }

            queryBuffer.append(") \n");
            reportQuery = queryBuffer.toString();
            System.out.println(queryBuffer.toString());

        } else if (reportName.equalsIgnoreCase("GLIF_DEPOSIT_REPORT")) {

            queryBuffer.append(" select * from (select to_char(t.jr_date,'DD-MON-YYYY') as JR_DATE,"
                    + " t.txn_ref_no as TXN_REF_NO,"
                    + " TO_CHAR(t.tran_date,'DD-MON-YYYY') as TRAN_DATE,t.pacs_id as PACS_ID,"
                    + " TO_CHAR(t.post_date,'DD-MON-YYYY') as POST_DATE,"
                    + " t.gl_class_code as GL_CLASS_CODE,t.txn_amt AS TXN_AMT,t.txn_ind AS TXN_IND,t.acct_type AS ACCT_TYPE,"
                    + " t.prod_name AS PROD_NAME,t.prod_code AS PROD_CODE,t.intt_cat AS INTT_CAT,"
                    + " t.key_1 AS ACCOUNT_NO"
                    + " from txn_journal t \n");
            queryBuffer.append("  where t.pacs_id='" + pacsId + "' \n");
            queryBuffer.append("  and t.jr_date=to_date ('" + Bean.getFromDate() + "','dd/mm/yyyy') ) \n");


            reportQuery = queryBuffer.toString();

        } else if (reportName.equalsIgnoreCase("LOAN_TRANSACTION_ENQUIRY_REPORT")) {

            queryBuffer.append("  select rownum as SL_NO, a.key_1 as ACCOUNT_NO,d.txn_ref_no as TXN_REF_NO,to_char(d.tran_date,'DD-MON-YYYY') AS TRAN_DATE, \n");
            queryBuffer.append("    (case d.tran_ind\n"
                    + "                             when 'DR' then 'Loan-Debit'\n"
                    + "                             when 'CR' then 'Loan-Credit'\n"
                    + "                        end)  as TXN_TYPE,d.txn_amt as TXN_AMT,p.PROD_NAME as PRODUCT_NAME,p.INTT_CAT_DESC as INTT_DESCRIPTION,d.END_BAL as END_BALANCE, d.NARRATION  \n");

            queryBuffer.append(" from loan_txn d,loan_account a, loan_product p \n");
            queryBuffer.append(" where d.acct_no=a.key_1\n"
                    + "                        and a.loan_prod_id=p.id and a.pacs_id='" + pacsId + "' \n");

            if (!accountNo.equalsIgnoreCase("")) {
                queryBuffer.append("    and  a.key_1='" + Bean.getAccountNo() + "' \n");
            }

            if ((!fromDate.equalsIgnoreCase("")) && (!toDate.equalsIgnoreCase(""))) {

                queryBuffer.append("    and  d.tran_date between  to_date ('" + Bean.getFromDate() + "','dd/mm/yyyy') \n");
                queryBuffer.append("   and to_date ('" + Bean.getToDate() + "','dd/mm/yyyy') \n");
            }

            if (!product.equalsIgnoreCase("")) {
                queryBuffer.append("    and a.dep_prod_id='" + Bean.getProductName() + "' \n");
            }

            if ((!fromAmount.equalsIgnoreCase("")) && (!toAmount.equalsIgnoreCase(""))) {
                queryBuffer.append("    and d.txn_amt between '" + Bean.getFromAmount() + "' \n");
                queryBuffer.append("    and '" + Bean.getToAmount() + "' \n");
            }
            if (!tranRefSearch.equalsIgnoreCase("")) {
                queryBuffer.append("    and  d.txn_ref_no='" + Bean.getTranRefSearch() + "' \n");
            }

            System.out.println(queryBuffer.toString());
            reportQuery = queryBuffer.toString();

        } else if (reportName.equalsIgnoreCase("NEFT_RTGS_REPORT")) {

            queryBuffer.append("select n.txn_no as TXN_NO,"
                    + " n.src_ac_no as SRC_AC_NO,"
                    + " n.dest_ac_no as DEST_AC_NO,n.beneficiary_name as BENEFICIARY_NAME,"
                    + "n.beneficiary_add as BENEFICIARY_ADDRESS,\n"
                    + "n.comm_txn_amt as COMM_AMOUNT,n.comm_txn_no as COMM_TXN_NO,"
                    + "n.ifsc_code as IFSC_CODE,n.txn_amt as TXN_AMT,n.status as STATUS,substr(to_char(n.txn_date),1,10) as TXN_DATE,\n"
                    + " b.IDI_BANK_NAME as BANK_NAME,b.IDI_BRANCH_NAME as BRANCH_NAME"
                    + " from neft_rtgs_txn n, IDI_IFSC_DIR_INFO b \n");
            queryBuffer.append(" where (n.ifsc_code = b.IDI_IFSC_CODE) and \n");
            queryBuffer.append("  (n.src_ac_no like '%" + Bean.getRemAccNo() + "%' and \n");
            queryBuffer.append("  n.dest_ac_no like '%" + Bean.getBenAccNo() + "%' and \n");
            queryBuffer.append("  n.ifsc_code like '%" +Bean.getIfscNoVal2()+ "%' and \n");
            queryBuffer.append("  n.txn_no like '%" + Bean.getTxnNo()+ "%' and \n");
            queryBuffer.append(" n.txn_date = to_date('"+Bean.getTxnFromDate()+"', 'dd/mm/yyyy') and \n");
           // queryBuffer.append("  to_date('"+Bean.getTxnToDate()+"', 'dd/mm/yyyy') and");
            queryBuffer.append(" n.pacs_id='" + pacsId + "')\n");

            reportQuery = queryBuffer.toString();
            

        }

        queryBuffer.delete(0, queryBuffer.length()-1);
       // System.out.println("qrybuffer length:"+queryBuffer.length());
        return reportQuery;
    }

    // Here provide the Headers & Type of Headers of the Report
    public ArrayList getReportHeader() {
        reportHeader = new ArrayList();
        if (reportName.equalsIgnoreCase("BULK_TRANSACTION_REPORT")) {
            reportHeader.add(new Heading("SL_NO", TYPE_STRING));
            reportHeader.add(new Heading("DCCB_NAME", TYPE_STRING));
            reportHeader.add(new Heading("SAVINGS_ACCOUNT_NO", TYPE_STRING));
            reportHeader.add(new Heading("CIF_NO", TYPE_STRING));
            reportHeader.add(new Heading("PRODUCT_CODE", TYPE_STRING));
            reportHeader.add(new Heading("INTEREST_CATEGORY", TYPE_STRING));
            reportHeader.add(new Heading("TRANSACTION_POSTING_DATE", TYPE_STRING));
            reportHeader.add(new Heading("JOURNAL_NO", TYPE_STRING));
            reportHeader.add(new Heading("TRANSACTION_TYPE", TYPE_STRING));
            reportHeader.add(new Heading("TRANSACTION_AMOUNT", TYPE_STRING));
            reportHeader.add(new Heading("COMMENTS", TYPE_STRING));

        } else if (reportName.equalsIgnoreCase("EOD_INTT_COMPUTATION_REPORT")) {
            reportHeader.add(new Heading("SL_NO", TYPE_STRING));
            reportHeader.add(new Heading("ACTIVITY", TYPE_STRING));
            reportHeader.add(new Heading("PACS_ID", TYPE_STRING));
            reportHeader.add(new Heading("ACCOUNT_NO", TYPE_STRING));
            reportHeader.add(new Heading("REMARKS", TYPE_STRING));
            reportHeader.add(new Heading("TRANSACTION_DATE", TYPE_STRING));

        } else if (reportName.equalsIgnoreCase("BULK_KYC_REPORT")) {
            reportHeader.add(new Heading("SL_NO", TYPE_STRING));
            reportHeader.add(new Heading("BANK_NAME", TYPE_STRING));
            reportHeader.add(new Heading("CBS_BR_CODE", TYPE_STRING));
            reportHeader.add(new Heading("CIF_NO", TYPE_STRING));
            reportHeader.add(new Heading("CUSTOMER_TYPE", TYPE_STRING));
            reportHeader.add(new Heading("LINKED_SB_ACCNO", TYPE_STRING));
            reportHeader.add(new Heading("TITLE", TYPE_STRING));
            reportHeader.add(new Heading("FIRST_NAME", TYPE_STRING));
            reportHeader.add(new Heading("MIDDLE_NAME", TYPE_STRING));
            reportHeader.add(new Heading("LAST_NAME", TYPE_STRING));
            reportHeader.add(new Heading("GUARDIAN_NAME", TYPE_STRING));
            reportHeader.add(new Heading("ADDRESS_1", TYPE_STRING));
            reportHeader.add(new Heading("ADDRESS_2", TYPE_STRING));
            reportHeader.add(new Heading("ADDRESS_3", TYPE_STRING));
            reportHeader.add(new Heading("DISTRICT", TYPE_STRING));
            reportHeader.add(new Heading("CITY", TYPE_STRING));
            reportHeader.add(new Heading("STATE", TYPE_STRING));
            reportHeader.add(new Heading("BIRTH_DATE", TYPE_STRING));
            reportHeader.add(new Heading("GENDER", TYPE_STRING));
            reportHeader.add(new Heading("MOBILE_NO", TYPE_STRING));
            reportHeader.add(new Heading("ID_TYPE", TYPE_STRING));
            reportHeader.add(new Heading("ID_NO", TYPE_STRING));
            reportHeader.add(new Heading("ID_ISSUE_DATE", TYPE_STRING));
            reportHeader.add(new Heading("ID_ISSUED_AT", TYPE_STRING));
            reportHeader.add(new Heading("POST_DATE", TYPE_STRING));
            reportHeader.add(new Heading("COMMENTS", TYPE_STRING));

        } else if (reportName.equalsIgnoreCase("ACCOUNT_ENQUIRY_REPORT")) {
            reportHeader.add(new Heading("SL_NO", TYPE_STRING));
            reportHeader.add(new Heading("ACCOUNT_NO", TYPE_STRING));
            reportHeader.add(new Heading("ACCT_OPEN_DT", TYPE_STRING));
            reportHeader.add(new Heading("LINKED_CBS_ACCOUNT_NO", TYPE_STRING));
            reportHeader.add(new Heading("AVAIL_BAL", TYPE_STRING));
            reportHeader.add(new Heading("CUSTOMER_NO", TYPE_STRING));
            reportHeader.add(new Heading("SANCTION_AMT", TYPE_STRING));
            reportHeader.add(new Heading("CURR_STATUS", TYPE_STRING));
            reportHeader.add(new Heading("PRIN_OUTST", TYPE_STRING));
            reportHeader.add(new Heading("INTT_OUTST", TYPE_STRING));
            reportHeader.add(new Heading("PENAL_INTT_PAID", TYPE_STRING));
            reportHeader.add(new Heading("CUST_NAME", TYPE_STRING));
            reportHeader.add(new Heading("PRODUCT_NAME", TYPE_STRING));
            reportHeader.add(new Heading("LIMIT_EXPIRY_DATE", TYPE_STRING));
            reportHeader.add(new Heading("PRINCIPAL_PAID", TYPE_STRING));
            reportHeader.add(new Heading("INTEREST_PAID", TYPE_STRING));
            reportHeader.add(new Heading("PENAL_INTT_OUTSTANDING", TYPE_STRING));
            reportHeader.add(new Heading("OLD_ACCOUNT_NUMBER", TYPE_STRING));
            reportHeader.add(new Heading("OLD_CIF_NUMBER", TYPE_STRING));

        } else if (reportName.equalsIgnoreCase("TRANSACTION_ENQUIRY_REPORT")) {
            reportHeader.add(new Heading("SL_NO", TYPE_STRING));
            reportHeader.add(new Heading("ACCOUNT_NO", TYPE_STRING));
            reportHeader.add(new Heading("LINKED_CBS_ACCOUNT_NO", TYPE_STRING));
            reportHeader.add(new Heading("CBS_REF_NO", TYPE_STRING));
            reportHeader.add(new Heading("TRAN_DATE", TYPE_STRING));
            reportHeader.add(new Heading("TXN_TYPE", TYPE_STRING));
            reportHeader.add(new Heading("TXN_AMT", TYPE_STRING));
            reportHeader.add(new Heading("LIMIT_EXPIRY_DATE", TYPE_STRING));
            reportHeader.add(new Heading("PRODUCT_NAME", TYPE_STRING));
            reportHeader.add(new Heading("END_BALANCE", TYPE_STRING));

        } else if (reportName.equalsIgnoreCase("GL_ACCOUNT_ENQUIRY_REPORT")) {
            reportHeader.add(new Heading("SL_NO", TYPE_STRING));
            reportHeader.add(new Heading("GL_ACCOUNT_NO", TYPE_STRING));
            reportHeader.add(new Heading("LEDGER_NAME", TYPE_STRING));
            reportHeader.add(new Heading("GL_ACCT_OPEN_DT", TYPE_STRING));
            reportHeader.add(new Heading("CURRENT_BALANCE", TYPE_STRING));
            reportHeader.add(new Heading("STATUS", TYPE_STRING));
            reportHeader.add(new Heading("GL_CODE", TYPE_STRING));
            reportHeader.add(new Heading("GL_NAME", TYPE_STRING));

        } else if (reportName.equalsIgnoreCase("GL_TRANSACTION_ENQUIRY_REPORT")) {
            reportHeader.add(new Heading("SL_NO", TYPE_STRING));
            reportHeader.add(new Heading("GL_ACCOUNT_NO", TYPE_STRING));
            reportHeader.add(new Heading("GL_CODE", TYPE_STRING));
            reportHeader.add(new Heading("CBS_REF_NO", TYPE_STRING));
            reportHeader.add(new Heading("TRAN_DATE", TYPE_STRING));
            reportHeader.add(new Heading("JRNL_NO", TYPE_STRING));
            reportHeader.add(new Heading("TXN_TYPE", TYPE_STRING));
            reportHeader.add(new Heading("TXN_AMT", TYPE_STRING));
            reportHeader.add(new Heading("TRANSACTION_NARRATION", TYPE_STRING));

        } else if (reportName.equalsIgnoreCase("DEPOSIT_ACCOUNT_ENQUIRY_REPORT")) {

            reportHeader.add(new Heading("SL_NO", TYPE_STRING));
            reportHeader.add(new Heading("ACCOUNT_NO", TYPE_STRING));
            reportHeader.add(new Heading("LINKED_CBS_ACCOUNT_NO", TYPE_STRING));
            reportHeader.add(new Heading("CUSTOMER_NO", TYPE_STRING));
            reportHeader.add(new Heading("PROD_NAME", TYPE_STRING));
            reportHeader.add(new Heading("CUST_NAME", TYPE_STRING));
            reportHeader.add(new Heading("ACCT_OPEN_DT", TYPE_STRING));
            reportHeader.add(new Heading("CURR_STATUS", TYPE_STRING));
            reportHeader.add(new Heading("AVAILABLE_BALANCE", TYPE_STRING));
            //reportHeader.add(new Heading("HOLD_VALUE", TYPE_STRING));
            reportHeader.add(new Heading("INTT_RATE", TYPE_STRING));
            reportHeader.add(new Heading("INTT_AVAILABLE", TYPE_STRING));
            reportHeader.add(new Heading("INTT_EOP_DATE", TYPE_STRING));
            reportHeader.add(new Heading("INTT_SOP_DATE", TYPE_STRING));
            reportHeader.add(new Heading("TERM_VALUE", TYPE_STRING));
            reportHeader.add(new Heading("MATURITY_VALUE", TYPE_STRING));
            reportHeader.add(new Heading("MATURITY_DATE", TYPE_STRING));
            reportHeader.add(new Heading("TERM_FROM_DATE", TYPE_STRING));
            reportHeader.add(new Heading("TERM_TO_DATE", TYPE_STRING));
            reportHeader.add(new Heading("INTT_PROJECTED", TYPE_STRING));
            reportHeader.add(new Heading("CAPITALIZED_INTEREST", TYPE_STRING));
            reportHeader.add(new Heading("INSTALL_AMT", TYPE_STRING));
            reportHeader.add(new Heading("NO_INST_PAID", TYPE_STRING));
            reportHeader.add(new Heading("NXT_DUE_DATE", TYPE_STRING));
            reportHeader.add(new Heading("HOLD_VALUE", TYPE_STRING));
            reportHeader.add(new Heading("TERM_LENGTH", TYPE_STRING));
            reportHeader.add(new Heading("INT_REPAY_METHOD", TYPE_STRING));
            reportHeader.add(new Heading("OLD_ACCOUNT_NUMBER", TYPE_STRING));
            reportHeader.add(new Heading("MODE_OF_ACC", TYPE_STRING));








        } else if (reportName.equalsIgnoreCase("DEP_TXN_ENQ_REPORT")) {
            reportHeader.add(new Heading("SL_NO", TYPE_STRING));
            reportHeader.add(new Heading("ACCOUNT_NO", TYPE_STRING));
            reportHeader.add(new Heading("PRODUCT_NAME", TYPE_STRING));
            reportHeader.add(new Heading("INTT_DESCRIPTION", TYPE_STRING));
            reportHeader.add(new Heading("CBS_REF_NO", TYPE_STRING));
            reportHeader.add(new Heading("TRAN_DATE", TYPE_STRING));
            reportHeader.add(new Heading("TXN_TYPE", TYPE_STRING));
            reportHeader.add(new Heading("TXN_AMT", TYPE_STRING));
            reportHeader.add(new Heading("END_BALANCE", TYPE_STRING));
            reportHeader.add(new Heading("NARRATION", TYPE_STRING));



        } else if (reportName.equalsIgnoreCase("LOAN_REPAYMENT_SCHEDULE_REPORT")) {
            reportHeader.add(new Heading("INSTALL_NO", TYPE_STRING));
            reportHeader.add(new Heading("LOAN_ACCOUNT_NO", TYPE_STRING));
            reportHeader.add(new Heading("REPAY_YYYYMM", TYPE_STRING));
            reportHeader.add(new Heading("EMI_AMOUNT", TYPE_STRING));
            reportHeader.add(new Heading("PRINCIPAL_AMOUNT", TYPE_STRING));
            reportHeader.add(new Heading("INTEREST_AMOUNT", TYPE_STRING));
            reportHeader.add(new Heading("PRINCIPAL_OUTSTANDING", TYPE_STRING));
            reportHeader.add(new Heading("OPENING_BALANCE", TYPE_STRING));
            reportHeader.add(new Heading("CLOSING_BALANCE", TYPE_STRING));

        } else if (reportName.equalsIgnoreCase("LOAN_ACCOUNT_ENQUIRY_REPORT")) {
            reportHeader.add(new Heading("SL_NO", TYPE_STRING));
            reportHeader.add(new Heading("LOAN_ACCOUNT_NO", TYPE_STRING));
            reportHeader.add(new Heading("CUSTOMER_NO", TYPE_STRING));
            reportHeader.add(new Heading("CUSTOMER_NAME", TYPE_STRING));
            reportHeader.add(new Heading("PRODUCT_NAME", TYPE_STRING));
            reportHeader.add(new Heading("INTEREST_CATEGORY", TYPE_STRING));
            reportHeader.add(new Heading("LOAN_TYPE", TYPE_STRING));
            reportHeader.add(new Heading("INTEREST_RATE", TYPE_STRING));
            reportHeader.add(new Heading("SANCTIONED_AMOUNT", TYPE_STRING));
            reportHeader.add(new Heading("SANCTIONED_DATE", TYPE_STRING));
            reportHeader.add(new Heading("CURR_STATUS", TYPE_STRING));
            reportHeader.add(new Heading("AMOUNT_DISBURSED", TYPE_STRING));
            reportHeader.add(new Heading("EMI_AMOUNT", TYPE_STRING));
            reportHeader.add(new Heading("PRIN_OUTSTD", TYPE_STRING));
            reportHeader.add(new Heading("INTT_OUTSTD", TYPE_STRING));
            reportHeader.add(new Heading("PRIN_PAID", TYPE_STRING));
            reportHeader.add(new Heading("INTT_PAID", TYPE_STRING));
            reportHeader.add(new Heading("TOTAL_INTT_OUTST", TYPE_STRING));
            reportHeader.add(new Heading("TOTAL_INTT_ACCR", TYPE_STRING));
            reportHeader.add(new Heading("TOTAL_INTT_PAID", TYPE_STRING));
            reportHeader.add(new Heading("NEXT_DUE_DATE", TYPE_STRING));
            reportHeader.add(new Heading("LAST_REPAYMENT_DATE", TYPE_STRING));
            reportHeader.add(new Heading("OLD_ACCOUNT_NUMBER", TYPE_STRING));

        } else if (reportName.equalsIgnoreCase("GLIF_DEPOSIT_REPORT")) {
            reportHeader.add(new Heading("JR_DATE", TYPE_STRING));
            reportHeader.add(new Heading("TXN_REF_NO", TYPE_STRING));
            reportHeader.add(new Heading("TRAN_DATE", TYPE_STRING));
            reportHeader.add(new Heading("PACS_ID", TYPE_STRING));
            reportHeader.add(new Heading("POST_DATE", TYPE_STRING));
            reportHeader.add(new Heading("GL_CLASS_CODE", TYPE_STRING));
            reportHeader.add(new Heading("TXN_AMT", TYPE_STRING));
            reportHeader.add(new Heading("TXN_IND", TYPE_STRING));
            reportHeader.add(new Heading("ACCT_TYPE", TYPE_STRING));
            reportHeader.add(new Heading("PROD_NAME", TYPE_STRING));
            reportHeader.add(new Heading("PROD_CODE", TYPE_STRING));
            reportHeader.add(new Heading("INTT_CAT", TYPE_STRING));
            reportHeader.add(new Heading("ACCOUNT_NO", TYPE_STRING));

        } else if (reportName.equalsIgnoreCase("LOAN_TRANSACTION_ENQUIRY_REPORT")) {
            reportHeader.add(new Heading("SL_NO", TYPE_STRING));
            reportHeader.add(new Heading("ACCOUNT_NO", TYPE_STRING));
            reportHeader.add(new Heading("PRODUCT_NAME", TYPE_STRING));
            reportHeader.add(new Heading("INTT_DESCRIPTION", TYPE_STRING));
            reportHeader.add(new Heading("TXN_REF_NO", TYPE_STRING));
            reportHeader.add(new Heading("TRAN_DATE", TYPE_STRING));
            reportHeader.add(new Heading("TXN_TYPE", TYPE_STRING));
            reportHeader.add(new Heading("TXN_AMT", TYPE_STRING));
            reportHeader.add(new Heading("END_BALANCE", TYPE_STRING));
            reportHeader.add(new Heading("NARRATION", TYPE_STRING));



        } else if (reportName.equalsIgnoreCase("NEFT_RTGS_REPORT")){
            reportHeader.add(new Heading("TXN_NO", TYPE_STRING));
            reportHeader.add(new Heading("SRC_AC_NO", TYPE_STRING));
            reportHeader.add(new Heading("DEST_AC_NO", TYPE_STRING));
            reportHeader.add(new Heading("BENEFICIARY_NAME", TYPE_STRING));
            reportHeader.add(new Heading("BENEFICIARY_ADDRESS", TYPE_STRING));
            reportHeader.add(new Heading("BANK_NAME", TYPE_STRING));
            reportHeader.add(new Heading("BRANCH_NAME", TYPE_STRING));
            reportHeader.add(new Heading("IFSC_CODE", TYPE_STRING));
            reportHeader.add(new Heading("TXN_AMT", TYPE_STRING));
            reportHeader.add(new Heading("COMM_TXN_NO", TYPE_STRING));
            reportHeader.add(new Heading("COMM_AMOUNT", TYPE_STRING));
            reportHeader.add(new Heading("STATUS", TYPE_STRING));
            reportHeader.add(new Heading("TXN_DATE", TYPE_STRING));
        }

        return reportHeader;
    }
}
