Пример #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string fundCode   = "";
        string branchCode = "";

        if (BaseContent.IsSessionExpired())
        {
            Response.Redirect("../../Default.aspx");
            return;
        }
        bcContent = (BaseClass)Session["BCContent"];

        userObj.UserID = bcContent.LoginID.ToString();
        CDSStatus      = bcContent.CDS.ToString().ToUpper();
        branchCode     = (string)Session["branchCode"];
        fundCode       = (string)Session["fundCode"];


        DataTable dtReport = reportObj.getDtForReportStatement();

        dtReport.TableName = "ReportSaleStatement";
        DataRow drReport;

        DataTable dtReportStatement = (DataTable)Session["dtReportStatement"];

        if (dtReportStatement.Rows.Count > 0)
        {
            int saleNo = 0;


            for (int looper = 0; looper < dtReportStatement.Rows.Count; looper++)
            {
                drReport            = dtReport.NewRow();
                drReport["SL_NO"]   = Convert.ToInt32(dtReportStatement.Rows[looper]["SL_NO"].ToString());
                drReport["SL_DT"]   = dtReportStatement.Rows[looper]["SL_DT"].Equals(DBNull.Value) ? "" : dtReportStatement.Rows[looper]["SL_DT"].ToString();
                drReport["SL_TYPE"] = dtReportStatement.Rows[looper]["SL_TYPE"].Equals(DBNull.Value) ? "" : dtReportStatement.Rows[looper]["SL_TYPE"].ToString();
                drReport["HNAME"]   = dtReportStatement.Rows[looper]["HNAME"].Equals(DBNull.Value) ? "" : dtReportStatement.Rows[looper]["HNAME"].ToString();
                drReport["MOBILE1"] = dtReportStatement.Rows[looper]["MOBILE1"].Equals(DBNull.Value) ? "" : dtReportStatement.Rows[looper]["MOBILE1"].ToString();

                drReport["NID"]          = dtReportStatement.Rows[looper]["NID"].Equals(DBNull.Value) ? "" : dtReportStatement.Rows[looper]["NID"].ToString();
                drReport["MONY_RECT_NO"] = dtReportStatement.Rows[looper]["MONY_RECT_NO"].Equals(DBNull.Value) ? "" : dtReportStatement.Rows[looper]["MONY_RECT_NO"].ToString();

                drReport["TIN"] = dtReportStatement.Rows[looper]["TIN"].Equals(DBNull.Value) ? "" : dtReportStatement.Rows[looper]["TIN"].ToString();
                if (!dtReportStatement.Rows[looper]["REG_TYPE"].Equals(DBNull.Value))
                {
                    drReport["REG_TYPE"] = reportObj.getRegTypeFullName(dtReportStatement.Rows[looper]["REG_TYPE"].ToString()).ToString();
                }
                drReport["JNT_NAME"] = dtReportStatement.Rows[looper]["JNT_NAME"].Equals(DBNull.Value) ? "" : dtReportStatement.Rows[looper]["JNT_NAME"].ToString();
                drReport["ADDRS1"]   = dtReportStatement.Rows[looper]["ADDRS1"].Equals(DBNull.Value) ? "" : dtReportStatement.Rows[looper]["ADDRS1"].ToString();
                drReport["ADDRS2"]   = dtReportStatement.Rows[looper]["ADDRS2"].Equals(DBNull.Value) ? "" : dtReportStatement.Rows[looper]["ADDRS2"].ToString();
                drReport["CITY"]     = dtReportStatement.Rows[looper]["CITY"].Equals(DBNull.Value) ? "" : dtReportStatement.Rows[looper]["CITY"].ToString();
                drReport["REG_NO"]   = dtReportStatement.Rows[looper]["REG_NO"].Equals(DBNull.Value) ? "" : dtReportStatement.Rows[looper]["REG_NO"].ToString();

                DataTable dtNominee = reportObj.dtNominee(dtReportStatement.Rows[looper]["REG_BK"].ToString(), dtReportStatement.Rows[looper]["REG_BR"].ToString(), Convert.ToInt32(dtReportStatement.Rows[looper]["RG_NO"].ToString()));
                if (dtNominee.Rows.Count > 0)
                {
                    for (int loop = 0; loop < dtNominee.Rows.Count; loop++)
                    {
                        if (Convert.ToInt16(dtNominee.Rows[loop]["NOMI_NO"].ToString()) == 1)
                        {
                            drReport["NOMI1_NAME"] = dtNominee.Rows[loop]["NOMI_NAME"].Equals(DBNull.Value) ? "" : dtNominee.Rows[loop]["NOMI_NAME"].ToString();
                        }
                        else if (Convert.ToInt16(dtNominee.Rows[loop]["NOMI_NO"].ToString()) == 2)
                        {
                            drReport["NOMI2_NAME"] = dtNominee.Rows[loop]["NOMI_NAME"].Equals(DBNull.Value) ? "" : dtNominee.Rows[loop]["NOMI_NAME"].ToString();
                        }
                    }
                }

                if (CDSStatus.ToString() == "Y")
                {
                    drReport["DRF_REF_NO"]          = dtReportStatement.Rows[looper]["DRF_REF_NO"];
                    drReport["DRF_REG_FOLIO_NO"]    = dtReportStatement.Rows[looper]["DRF_REG_FOLIO_NO"];
                    drReport["DRF_CERT_NO"]         = dtReportStatement.Rows[looper]["DRF_CERT_NO"];
                    drReport["DRF_DISTNCT_NO_FROM"] = dtReportStatement.Rows[looper]["DRF_DISTNCT_NO_FROM"];
                    drReport["DRF_DISTNCT_NO_TO"]   = dtReportStatement.Rows[looper]["DRF_DISTNCT_NO_TO"];
                    drReport["DRF_CUST_REQ_DATE"]   = dtReportStatement.Rows[looper]["DRF_CUST_REQ_DATE"];
                    drReport["DRF_ACCEPT_NO"]       = dtReportStatement.Rows[looper]["DRF_ACCEPT_NO"];
                    drReport["DRF_DRN"]             = dtReportStatement.Rows[looper]["DRF_DRN"];
                    drReport["DRF_ACCEPT_DATE"]     = dtReportStatement.Rows[looper]["DRF_ACCEPT_DATE"];
                    drReport["DRF_TR_SEQ_NO"]       = dtReportStatement.Rows[looper]["DRF_TR_SEQ_NO"];
                    drReport["DRF_TR_DATE"]         = dtReportStatement.Rows[looper]["DRF_TR_DATE"];
                    drReport["BO"] = dtReportStatement.Rows[looper]["HOLDER_BO"];
                }
                else
                {
                    saleNo = Convert.ToInt32(dtReportStatement.Rows[looper]["SL_NO"].ToString());
                    drReport["CERT_DLVRY_DT"] = dtReportStatement.Rows[looper]["CERT_DLVRY_DT"].Equals(DBNull.Value) ? "" : dtReportStatement.Rows[looper]["CERT_DLVRY_DT"].ToString();
                    drReport["CERT_RCV_BY"]   = dtReportStatement.Rows[looper]["CERT_RCV_BY"].Equals(DBNull.Value) ? "" : dtReportStatement.Rows[looper]["CERT_RCV_BY"].ToString();
                    drReport["CERT_NO"]       = reportObj.getTotalCertNo("SELECT  NVL(CERT_TYPE,' ') AS CERT_TYPE, NVL(CERT_NO,0) AS CERT_NO FROM SALE_CERT WHERE SL_NO=" + saleNo + " AND REG_BK='" + fundCode.ToString() + "'AND REG_BR='" + branchCode.ToString() + "'  ORDER BY CERT_TYPE ", fundCode.ToString()).ToString();
                }


                if (!dtReportStatement.Rows[looper]["BK_FLAG"].Equals(DBNull.Value))
                {
                    if (string.Compare(dtReportStatement.Rows[looper]["BK_FLAG"].ToString(), "Y", true) == 0)
                    {
                        if (!dtReportStatement.Rows[looper]["BK_NM_CD"].Equals(DBNull.Value) && !dtReportStatement.Rows[looper]["BK_BR_NM_CD"].Equals(DBNull.Value) && !dtReportStatement.Rows[looper]["BK_AC_NO"].Equals(DBNull.Value))
                        {
                            drReport["BK_AC_NO"]       = dtReportStatement.Rows[looper]["BK_AC_NO"].ToString();
                            drReport["BANK_NAME"]      = reportObj.getBankNameByBankCode(Convert.ToInt16(dtReportStatement.Rows[looper]["BK_NM_CD"].ToString())).ToString();
                            drReport["BRANCH_NAME"]    = reportObj.getBankBranchNameByCode(Convert.ToInt16(dtReportStatement.Rows[looper]["BK_NM_CD"].ToString()), Convert.ToInt16(dtReportStatement.Rows[looper]["BK_BR_NM_CD"].ToString())).ToString();
                            drReport["BRANCH_ADDRESS"] = reportObj.getBankBranchAddressByCode(Convert.ToInt16(dtReportStatement.Rows[looper]["BK_NM_CD"].ToString()), Convert.ToInt16(dtReportStatement.Rows[looper]["BK_BR_NM_CD"].ToString())).ToString();
                        }
                        else
                        {
                        }
                    }
                }
                drReport["CIP"]    = dtReportStatement.Rows[looper]["CIP"].Equals(DBNull.Value) ? "" : dtReportStatement.Rows[looper]["CIP"].ToString();
                drReport["ID_AC"]  = dtReportStatement.Rows[looper]["ID_AC"].Equals(DBNull.Value) ? "" : dtReportStatement.Rows[looper]["ID_AC"].ToString();
                drReport["QTY"]    = Convert.ToInt32(dtReportStatement.Rows[looper]["QTY"].Equals(DBNull.Value) ? "0": dtReportStatement.Rows[looper]["QTY"].ToString());
                drReport["RATE"]   = decimal.Parse(dtReportStatement.Rows[looper]["RATE"].Equals(DBNull.Value) ? "0" : dtReportStatement.Rows[looper]["RATE"].ToString());
                drReport["AMOUNT"] = decimal.Parse(dtReportStatement.Rows[looper]["AMOUNT"].Equals(DBNull.Value) ? "0" : dtReportStatement.Rows[looper]["AMOUNT"].ToString());


                dtReport.Rows.Add(drReport);
            }


            //dtReport.WriteXmlSchema(@"F:\GITHUB_AMCL\DOTNET2015\AMCL.OPENMF\AMCL.REPORT\XMLSCHEMAS\dtUnitReportForStatement.xsd");
            if (CDSStatus.ToString() == "Y")
            {
                sale_Statement_CDS.Refresh();
                sale_Statement_CDS.SetDataSource(dtReport);

                sale_Statement_CDS.SetParameterValue("fundName", opendMFDAO.GetFundName(fundCode.ToString()));
                sale_Statement_CDS.SetParameterValue("branchName", opendMFDAO.GetBranchName(branchCode.ToString()).ToString());
                sale_Statement_CDS.SetParameterValue("branchCode", branchCode.ToString());

                CrystalReportViewer1.ReportSource = sale_Statement_CDS;
            }
            else
            {
                sale_Statement.Refresh();
                sale_Statement.SetDataSource(dtReport);

                sale_Statement.SetParameterValue("fundName", opendMFDAO.GetFundName(fundCode.ToString()));
                sale_Statement.SetParameterValue("branchName", opendMFDAO.GetBranchName(branchCode.ToString()).ToString());
                sale_Statement.SetParameterValue("branchCode", branchCode.ToString());

                CrystalReportViewer1.ReportSource = sale_Statement;
            }
        }
        else
        {
            Response.Write("No data found");
        }
    }
Пример #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string fundCode   = "";
        string branchCode = "";

        if (BaseContent.IsSessionExpired())
        {
            Response.Redirect("../../Default.aspx");
            return;
        }
        bcContent = (BaseClass)Session["BCContent"];

        userObj.UserID = bcContent.LoginID.ToString();
        branchCode     = (string)Session["branchCode"];
        fundCode       = (string)Session["fundCode"];


        DataTable dtReport = reportObj.getDtForReportStatement();

        dtReport.TableName = "ReportStatement";
        DataRow drReport;

        DataTable dtReportStatement = (DataTable)Session["dtReportStatement"];

        if (dtReportStatement.Rows.Count > 0)
        {
            int saleNo = 0;


            for (int looper = 0; looper < dtReportStatement.Rows.Count; looper++)
            {
                drReport            = dtReport.NewRow();
                drReport["SL_NO"]   = Convert.ToInt32(dtReportStatement.Rows[looper]["SL_NO"].ToString());
                drReport["SL_DT"]   = dtReportStatement.Rows[looper]["SL_DT"].Equals(DBNull.Value) ? "" : dtReportStatement.Rows[looper]["SL_DT"].ToString();
                drReport["SL_TYPE"] = dtReportStatement.Rows[looper]["SL_TYPE"].Equals(DBNull.Value) ? "" : dtReportStatement.Rows[looper]["SL_TYPE"].ToString();
                drReport["HNAME"]   = dtReportStatement.Rows[looper]["HNAME"].Equals(DBNull.Value) ? "" : dtReportStatement.Rows[looper]["HNAME"].ToString();
                if (!dtReportStatement.Rows[looper]["REG_TYPE"].Equals(DBNull.Value))
                {
                    drReport["REG_TYPE"] = reportObj.getRegTypeFullName(dtReportStatement.Rows[looper]["REG_TYPE"].ToString()).ToString();
                }
                drReport["JNT_NAME"] = dtReportStatement.Rows[looper]["JNT_NAME"].Equals(DBNull.Value) ? "" : dtReportStatement.Rows[looper]["JNT_NAME"].ToString();
                drReport["ADDRS1"]   = dtReportStatement.Rows[looper]["ADDRS1"].Equals(DBNull.Value) ? "" : dtReportStatement.Rows[looper]["ADDRS1"].ToString();
                drReport["ADDRS2"]   = dtReportStatement.Rows[looper]["ADDRS2"].Equals(DBNull.Value) ? "" : dtReportStatement.Rows[looper]["ADDRS2"].ToString();
                drReport["CITY"]     = dtReportStatement.Rows[looper]["CITY"].Equals(DBNull.Value) ? "" : dtReportStatement.Rows[looper]["CITY"].ToString();
                drReport["REG_NO"]   = dtReportStatement.Rows[looper]["REG_NO"].Equals(DBNull.Value) ? "" : dtReportStatement.Rows[looper]["REG_NO"].ToString();

                drReport["CERT_DLVRY_DT"] = dtReportStatement.Rows[looper]["CERT_DLVRY_DT"].Equals(DBNull.Value) ? "" : dtReportStatement.Rows[looper]["CERT_DLVRY_DT"].ToString();
                drReport["CERT_RCV_BY"]   = dtReportStatement.Rows[looper]["CERT_RCV_BY"].Equals(DBNull.Value) ? "" : dtReportStatement.Rows[looper]["CERT_RCV_BY"].ToString();

                DataTable dtNominee = reportObj.dtNominee(dtReportStatement.Rows[looper]["REG_BK"].ToString(), dtReportStatement.Rows[looper]["REG_BR"].ToString(), Convert.ToInt32(dtReportStatement.Rows[looper]["RG_NO"].ToString()));
                if (dtNominee.Rows.Count > 0)
                {
                    for (int loop = 0; loop < dtNominee.Rows.Count; loop++)
                    {
                        if (Convert.ToInt16(dtNominee.Rows[loop]["NOMI_NO"].ToString()) == 1)
                        {
                            drReport["NOMI1_NAME"] = dtNominee.Rows[loop]["NOMI_NAME"].Equals(DBNull.Value) ? "" : dtNominee.Rows[loop]["NOMI_NAME"].ToString();
                        }
                        else if (Convert.ToInt16(dtNominee.Rows[loop]["NOMI_NO"].ToString()) == 2)
                        {
                            drReport["NOMI2_NAME"] = dtNominee.Rows[loop]["NOMI_NAME"].Equals(DBNull.Value) ? "" : dtNominee.Rows[loop]["NOMI_NAME"].ToString();
                        }
                    }
                }
                saleNo = Convert.ToInt32(dtReportStatement.Rows[looper]["SL_NO"].ToString());
                drReport["CERT_NO"] = reportObj.getTotalCertNo("SELECT NVL(CERT_TYPE,' ') AS CERT_TYPE, NVL(CERT_NO,0) AS CERT_NO FROM SALE_CERT WHERE SL_NO=" + saleNo + " AND REG_BK='" + fundCode.ToString() + "'AND REG_BR='" + branchCode.ToString() + "'", fundCode.ToString()).ToString();


                //if (!dtReportStatement.Rows[looper]["BK_FLAG"].Equals(DBNull.Value))
                //{
                //    if (string.Compare(dtReportStatement.Rows[looper]["BK_FLAG"].ToString(), "Y", true) == 0)
                //    {
                //        if (!dtReportStatement.Rows[looper]["BK_NM_CD"].Equals(DBNull.Value) && !dtReportStatement.Rows[looper]["BK_BR_NM_CD"].Equals(DBNull.Value) && !dtReportStatement.Rows[looper]["BK_AC_NO"].Equals(DBNull.Value))
                //        {
                //            drReport["BK_AC_NO"] = dtReportStatement.Rows[looper]["BK_AC_NO"].ToString();
                //            drReport["BANK_NAME"] = reportObj.getBankNameByBankCode(Convert.ToInt16(dtReportStatement.Rows[looper]["BK_NM_CD"].ToString())).ToString();
                //            drReport["BRANCH_NAME"] = reportObj.getBankBranchNameByCode(Convert.ToInt16(dtReportStatement.Rows[looper]["BK_NM_CD"].ToString()), Convert.ToInt16(dtReportStatement.Rows[looper]["BK_BR_NM_CD"].ToString())).ToString();
                //            drReport["BRANCH_ADDRESS"] = reportObj.getBankBranchAddressByCode(Convert.ToInt16(dtReportStatement.Rows[looper]["BK_NM_CD"].ToString()), Convert.ToInt16(dtReportStatement.Rows[looper]["BK_BR_NM_CD"].ToString())).ToString();
                //        }
                //        else
                //        {
                //            string branchAddress = "";
                //            string BankAccInfo = dtReportStatement.Rows[looper]["SPEC_IN1"].ToString() + dtReportStatement.Rows[looper]["SPEC_IN2"].ToString();
                //            string[] BankAccountInfo = BankAccInfo.Split(',');
                //            if (BankAccountInfo.Length > 0)
                //            {
                //                drReport["BK_AC_NO"] = BankAccountInfo[0].ToString();
                //                if (BankAccountInfo.Length > 1)
                //                {
                //                    drReport["BANK_NAME"] = BankAccountInfo[1].ToString();
                //                }
                //                if (BankAccountInfo.Length > 2)
                //                {
                //                    drReport["BRANCH_NAME"] = BankAccountInfo[2].ToString();
                //                }
                //                if (BankAccountInfo.Length > 3)
                //                {
                //                    for (int loop = 3; loop < BankAccountInfo.Length; loop++)
                //                    {
                //                        branchAddress = branchAddress + BankAccountInfo[loop].ToString();
                //                    }
                //                    drReport["BRANCH_ADDRESS"] = branchAddress;
                //                }

                //            }
                //        }
                //    }

                //}
                drReport["CIP"]    = dtReportStatement.Rows[looper]["CIP"].Equals(DBNull.Value) ? "" : dtReportStatement.Rows[looper]["CIP"].ToString();
                drReport["BO"]     = dtReportStatement.Rows[looper]["BO"].Equals(DBNull.Value) ? "" : dtReportStatement.Rows[looper]["BO"].ToString();
                drReport["TIN"]    = dtReportStatement.Rows[looper]["TIN"].Equals(DBNull.Value) ? "" : dtReportStatement.Rows[looper]["TIN"].ToString();
                drReport["BEFTN"]  = dtReportStatement.Rows[looper]["BEFTN"].Equals(DBNull.Value) ? "" : dtReportStatement.Rows[looper]["BEFTN"].ToString();
                drReport["ID_AC"]  = dtReportStatement.Rows[looper]["ID_AC"].Equals(DBNull.Value) ? "" : dtReportStatement.Rows[looper]["ID_AC"].ToString();
                drReport["QTY"]    = Convert.ToInt32(dtReportStatement.Rows[looper]["QTY"].Equals(DBNull.Value) ? "0": dtReportStatement.Rows[looper]["QTY"].ToString());
                drReport["RATE"]   = decimal.Parse(dtReportStatement.Rows[looper]["RATE"].Equals(DBNull.Value) ? "0" : dtReportStatement.Rows[looper]["RATE"].ToString());
                drReport["AMOUNT"] = decimal.Parse(dtReportStatement.Rows[looper]["AMOUNT"].Equals(DBNull.Value) ? "0" : dtReportStatement.Rows[looper]["AMOUNT"].ToString());


                dtReport.Rows.Add(drReport);
            }


            //dtReport.WriteXmlSchema(@"D:\Project\Web\AMCL.OPENMF\AMCL.REPORT\XMLSCHEMAS\dtUnitReportForStatement.xsd");


            CRSaleLedger.Refresh();
            CRSaleLedger.SetDataSource(dtReport);

            CRSaleLedger.SetParameterValue("fundName", opendMFDAO.GetFundName(fundCode.ToString()));
            CRSaleLedger.SetParameterValue("branchName", opendMFDAO.GetBranchName(branchCode.ToString()).ToString());
            CRSaleLedger.SetParameterValue("branchCode", branchCode.ToString());


            CrystalReportViewer1.ReportSource = CRSaleLedger;
        }
        else
        {
            Response.Write("No data found");
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        string fundCodeStatement   = "";
        string branchCodeStatement = "";

        if (BaseContent.IsSessionExpired())
        {
            Response.Redirect("../../Default.aspx");
            return;
        }
        bcContent = (BaseClass)Session["BCContent"];

        userObj.UserID      = bcContent.LoginID.ToString();
        branchCodeStatement = (string)Session["branchCodeStatement"];
        fundCodeStatement   = (string)Session["fundCodeStatement"];



        DataTable dtUnitHolderInfo = reportObj.getDtHolderInfo();

        dtUnitHolderInfo.TableName = "UnitHolderStatementAfterClosing";
        DataRow drUnitHolderInfo;

        DataTable dtHolderInfo = (DataTable)Session["dtStatementAfterClosing"];

        if (dtHolderInfo.Rows.Count > 0)
        {
            for (int looper = 0; looper < dtHolderInfo.Rows.Count; looper++)
            {
                drUnitHolderInfo           = dtUnitHolderInfo.NewRow();
                drUnitHolderInfo["REG_NO"] = dtHolderInfo.Rows[looper]["REGI_NUMBER"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["REGI_NUMBER"].ToString();


                drUnitHolderInfo["HNAME"]       = dtHolderInfo.Rows[looper]["HNAME"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["HNAME"].ToString();
                drUnitHolderInfo["REG_BR_NAME"] = dtHolderInfo.Rows[looper]["REG_BR"].Equals(DBNull.Value) ? "" : opendMFDAO.GetBranchName(dtHolderInfo.Rows[looper]["REG_BR"].ToString());

                drUnitHolderInfo["BEFTN"] = dtHolderInfo.Rows[looper]["BEFTN"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["BEFTN"].ToString();

                drUnitHolderInfo["ADDRS1"]        = dtHolderInfo.Rows[looper]["ADDRS1"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["ADDRS1"].ToString();
                drUnitHolderInfo["ADDRS2"]        = dtHolderInfo.Rows[looper]["ADDRS2"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["ADDRS2"].ToString();
                drUnitHolderInfo["CITY"]          = dtHolderInfo.Rows[looper]["CITY"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["CITY"].ToString();
                drUnitHolderInfo["TIN"]           = dtHolderInfo.Rows[looper]["TIN"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["TIN"].ToString();
                drUnitHolderInfo["PASS_NO"]       = dtHolderInfo.Rows[looper]["PASS_NO"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["BEFTN"].ToString();
                drUnitHolderInfo["BIRTH_CERT_NO"] = dtHolderInfo.Rows[looper]["BIRTH_CERT_NO"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["BEFTN"].ToString();
                drUnitHolderInfo["BIRTH_CERT_NO"] = dtHolderInfo.Rows[looper]["BIRTH_CERT_NO"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["BEFTN"].ToString();
                drUnitHolderInfo["NID"]           = dtHolderInfo.Rows[looper]["NID"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["NID"].ToString();
                drUnitHolderInfo["BALANCE"]       = Convert.ToInt32(dtHolderInfo.Rows[looper]["BALANCE"].Equals(DBNull.Value) ? "0" : dtHolderInfo.Rows[looper]["BALANCE"].ToString());

                drUnitHolderInfo["JNT_NAME"] = dtHolderInfo.Rows[looper]["JNT_NAME"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["JNT_NAME"].ToString();


                drUnitHolderInfo["CIP"] = dtHolderInfo.Rows[looper]["CIP"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["CIP"].ToString();

                if (!dtHolderInfo.Rows[looper]["CIP"].Equals(DBNull.Value))
                {
                    if (string.Compare(dtHolderInfo.Rows[looper]["CIP"].ToString(), "Y", true) == 0)
                    {
                        drUnitHolderInfo["CIP"] = "YES";
                    }
                    else if (string.Compare(dtHolderInfo.Rows[looper]["CIP"].ToString(), "N", true) == 0)
                    {
                        drUnitHolderInfo["CIP"] = "NO";
                    }
                }


                if (!dtHolderInfo.Rows[looper]["ID_FLAG"].Equals(DBNull.Value))
                {
                    if (string.Compare(dtHolderInfo.Rows[looper]["ID_FLAG"].ToString(), "Y", true) == 0)
                    {
                        drUnitHolderInfo["ID_FLAG"]                   = "YES";
                        drUnitHolderInfo["ID_AC"]                     = dtHolderInfo.Rows[looper]["ID_AC"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["ID_AC"].ToString();
                        drUnitHolderInfo["ID_INTSTITUTE_NAME"]        = dtHolderInfo.Rows[looper]["BANK_NAME"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["BANK_NAME"].ToString();
                        drUnitHolderInfo["ID_INTSTITUTE_BRANCH_NAME"] = dtHolderInfo.Rows[looper]["BRANCH_NAME"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["BRANCH_NAME"].ToString();
                    }
                    else if (string.Compare(dtHolderInfo.Rows[looper]["ID_FLAG"].ToString(), "N", true) == 0)
                    {
                        drUnitHolderInfo["ID_FLAG"] = "NO";
                    }
                }



                if (!dtHolderInfo.Rows[looper]["BK_FLAG"].Equals(DBNull.Value))
                {
                    if (string.Compare(dtHolderInfo.Rows[looper]["BK_FLAG"].ToString(), "Y", true) == 0)
                    {
                        if (!dtHolderInfo.Rows[looper]["BK_NM_CD"].Equals(DBNull.Value) && !dtHolderInfo.Rows[looper]["BK_BR_NM_CD"].Equals(DBNull.Value) && !dtHolderInfo.Rows[looper]["BK_AC_NO"].Equals(DBNull.Value))
                        {
                            drUnitHolderInfo["BK_AC_NO"]       = dtHolderInfo.Rows[looper]["BK_AC_NO"].ToString();
                            drUnitHolderInfo["BANK_NAME"]      = reportObj.getBankNameByBankCode(Convert.ToInt16(dtHolderInfo.Rows[looper]["BK_NM_CD"].ToString())).ToString();
                            drUnitHolderInfo["BRANCH_NAME"]    = reportObj.getBankBranchNameByCode(Convert.ToInt16(dtHolderInfo.Rows[looper]["BK_NM_CD"].ToString()), Convert.ToInt16(dtHolderInfo.Rows[looper]["BK_BR_NM_CD"].ToString())).ToString();
                            drUnitHolderInfo["BRANCH_ADDRESS"] = reportObj.getBankBranchAddressByCode(Convert.ToInt16(dtHolderInfo.Rows[looper]["BK_NM_CD"].ToString()), Convert.ToInt16(dtHolderInfo.Rows[looper]["BK_BR_NM_CD"].ToString())).ToString();
                        }
                        else
                        {
                            string   branchAddress   = "";
                            string   BankAccInfo     = dtHolderInfo.Rows[looper]["SPEC_IN1"].ToString() + dtHolderInfo.Rows[looper]["SPEC_IN2"].ToString();
                            string[] BankAccountInfo = BankAccInfo.Split(',');
                            if (BankAccountInfo.Length > 0)
                            {
                                drUnitHolderInfo["BK_AC_NO"] = BankAccountInfo[0].ToString();
                                if (BankAccountInfo.Length > 1)
                                {
                                    drUnitHolderInfo["BANK_NAME"] = BankAccountInfo[1].ToString();
                                }
                                if (BankAccountInfo.Length > 2)
                                {
                                    drUnitHolderInfo["BRANCH_NAME"] = BankAccountInfo[2].ToString();
                                }
                                if (BankAccountInfo.Length > 3)
                                {
                                    for (int loop = 3; loop < BankAccountInfo.Length; loop++)
                                    {
                                        branchAddress = branchAddress + BankAccountInfo[loop].ToString();
                                    }
                                    drUnitHolderInfo["BRANCH_ADDRESS"] = branchAddress;
                                }
                            }
                        }
                    }
                }


                DataTable dtNominee = reportObj.dtNominee(dtHolderInfo.Rows[looper]["REG_BK"].ToString(), dtHolderInfo.Rows[looper]["REG_BR"].ToString(), Convert.ToInt32(dtHolderInfo.Rows[looper]["REG_NO"].ToString()));
                if (dtNominee.Rows.Count > 0)
                {
                    for (int loop = 0; loop < dtNominee.Rows.Count; loop++)
                    {
                        if (Convert.ToInt16(dtNominee.Rows[loop]["NOMI_NO"].ToString()) == 1)
                        {
                            drUnitHolderInfo["NOMI1_NAME"] = dtNominee.Rows[loop]["NOMI_NAME"].Equals(DBNull.Value) ? "" : dtNominee.Rows[loop]["NOMI_NAME"].ToString();
                        }
                        else if (Convert.ToInt16(dtNominee.Rows[loop]["NOMI_NO"].ToString()) == 2)
                        {
                            drUnitHolderInfo["NOMI2_NAME"] = dtNominee.Rows[loop]["NOMI_NAME"].Equals(DBNull.Value) ? "" : dtNominee.Rows[loop]["NOMI_NAME"].ToString();
                        }
                    }
                }
                dtUnitHolderInfo.Rows.Add(drUnitHolderInfo);
            }

            //dtUnitHolderInfo.WriteXmlSchema(@"F:\GITHUB_AMCL\DOTNET2008\AMCL.OPENMF\AMCL.REPORT\XMLSCHEMAS\dtUnitHolderStatementAfterClosing.xsd");


            CR_StatementAfterClosing.Refresh();
            CR_StatementAfterClosing.SetDataSource(dtUnitHolderInfo);

            CR_StatementAfterClosing.SetParameterValue("branchName", opendMFDAO.GetBranchName(branchCodeStatement.ToString()));
            CR_StatementAfterClosing.SetParameterValue("fundName", opendMFDAO.GetFundName(fundCodeStatement.ToString()));
            CrystalReportViewer1.ReportSource = CR_StatementAfterClosing;
            //CR_StatementAfterClosing.Close();
            //CR_StatementAfterClosing.Dispose();
        }
        else
        {
            Response.Write("No data found");
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        string fundCode   = "";
        string branchCode = "";

        if (BaseContent.IsSessionExpired())
        {
            Response.Redirect("../../Default.aspx");
            return;
        }
        bcContent = (BaseClass)Session["BCContent"];

        userObj.UserID = bcContent.LoginID.ToString();
        branchCode     = (string)Session["branchCode"];
        fundCode       = (string)Session["fundCode"];


        DataTable dtUnitHolderInfo = reportObj.getDtHolderInfo();

        dtUnitHolderInfo.TableName = "UnitHolderInfo";
        DataRow drUnitHolderInfo;

        DataTable dtHolderInfo = (DataTable)Session["dtHolderInfo"];

        if (dtHolderInfo.Rows.Count > 0)
        {
            for (int looper = 0; looper < dtHolderInfo.Rows.Count; looper++)
            {
                drUnitHolderInfo           = dtUnitHolderInfo.NewRow();
                drUnitHolderInfo["REG_NO"] = dtHolderInfo.Rows[looper]["REG_NO"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["REG_NO"].ToString();
                drUnitHolderInfo["REG_DT"] = dtHolderInfo.Rows[looper]["REG_DT"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["REG_DT"].ToString();

                if (!dtHolderInfo.Rows[looper]["REG_TYPE"].Equals(DBNull.Value))
                {
                    drUnitHolderInfo["REG_TYPE"] = reportObj.getRegTypeFullName(dtHolderInfo.Rows[looper]["REG_TYPE"].ToString()).ToString();
                }

                drUnitHolderInfo["HNAME"]       = dtHolderInfo.Rows[looper]["HNAME"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["HNAME"].ToString();
                drUnitHolderInfo["FMH_NAME"]    = dtHolderInfo.Rows[looper]["FMH_NAME"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["FMH_NAME"].ToString();
                drUnitHolderInfo["MO_NAME"]     = dtHolderInfo.Rows[looper]["MO_NAME"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["MO_NAME"].ToString();
                drUnitHolderInfo["ADDRS1"]      = dtHolderInfo.Rows[looper]["ADDRS1"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["ADDRS1"].ToString();
                drUnitHolderInfo["ADDRS2"]      = dtHolderInfo.Rows[looper]["ADDRS2"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["ADDRS2"].ToString();
                drUnitHolderInfo["CITY"]        = dtHolderInfo.Rows[looper]["CITY"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["CITY"].ToString();
                drUnitHolderInfo["NATIONALITY"] = dtHolderInfo.Rows[looper]["NATIONALITY"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["NATIONALITY"].ToString();
                drUnitHolderInfo["OCC_CODE"]    = dtHolderInfo.Rows[looper]["OCC_CODE"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["OCC_CODE"].ToString();
                drUnitHolderInfo["B_DATE"]      = dtHolderInfo.Rows[looper]["B_DATE"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["B_DATE"].ToString();

                if (!dtHolderInfo.Rows[looper]["SEX"].Equals(DBNull.Value))
                {
                    if (string.Compare(dtHolderInfo.Rows[looper]["SEX"].ToString(), "M", true) == 0)
                    {
                        drUnitHolderInfo["SEX"] = "MAlE";
                    }
                    else if (string.Compare(dtHolderInfo.Rows[looper]["SEX"].ToString(), "F", true) == 0)
                    {
                        drUnitHolderInfo["SEX"] = "FEMALE";
                    }
                }


                if (!dtHolderInfo.Rows[looper]["MAR_STAT"].Equals(DBNull.Value))
                {
                    drUnitHolderInfo["MAR_STAT"] = reportObj.getMaritialFullName(dtHolderInfo.Rows[looper]["MAR_STAT"].ToString()).ToString();
                }

                if (!dtHolderInfo.Rows[looper]["RELIGION"].Equals(DBNull.Value))
                {
                    drUnitHolderInfo["RELIGION"] = reportObj.getReligionFullName(dtHolderInfo.Rows[looper]["RELIGION"].ToString()).ToString();
                }


                drUnitHolderInfo["EDU_QUA"] = dtHolderInfo.Rows[looper]["EDU_QUA"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["EDU_QUA"].ToString();
                drUnitHolderInfo["TEL_NO"]  = dtHolderInfo.Rows[looper]["TEL_NO"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["TEL_NO"].ToString();
                drUnitHolderInfo["EMAIL"]   = dtHolderInfo.Rows[looper]["EMAIL"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["EMAIL"].ToString();

                drUnitHolderInfo["JNT_NAME"]        = dtHolderInfo.Rows[looper]["JNT_NAME"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["JNT_NAME"].ToString();
                drUnitHolderInfo["JNT_FMH_NAME"]    = dtHolderInfo.Rows[looper]["JNT_FMH_NAME"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["JNT_FMH_NAME"].ToString();
                drUnitHolderInfo["JNT_MO_NAME"]     = dtHolderInfo.Rows[looper]["JNT_MO_NAME"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["JNT_MO_NAME"].ToString();
                drUnitHolderInfo["JNT_OCC_CODE"]    = dtHolderInfo.Rows[looper]["JNT_OCC_CODE"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["JNT_OCC_CODE"].ToString();
                drUnitHolderInfo["JNT_ADDRS1"]      = dtHolderInfo.Rows[looper]["JNT_ADDRS1"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["JNT_ADDRS1"].ToString();
                drUnitHolderInfo["JNT_ADDRS2"]      = dtHolderInfo.Rows[looper]["JNT_ADDRS2"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["JNT_ADDRS2"].ToString();
                drUnitHolderInfo["JNT_NATIONALITY"] = dtHolderInfo.Rows[looper]["JNT_NATIONALITY"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["JNT_NATIONALITY"].ToString();
                drUnitHolderInfo["JNT_CITY"]        = dtHolderInfo.Rows[looper]["JNT_CITY"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["JNT_CITY"].ToString();
                drUnitHolderInfo["JNT_TEL_NO"]      = dtHolderInfo.Rows[looper]["JNT_TEL_NO"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["JNT_TEL_NO"].ToString();
                drUnitHolderInfo["JNT_FMH_REL"]     = dtHolderInfo.Rows[looper]["JNT_FMH_REL"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["JNT_FMH_REL"].ToString();

                drUnitHolderInfo["CIP"] = dtHolderInfo.Rows[looper]["CIP"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["CIP"].ToString();

                if (!dtHolderInfo.Rows[looper]["CIP"].Equals(DBNull.Value))
                {
                    if (string.Compare(dtHolderInfo.Rows[looper]["CIP"].ToString(), "Y", true) == 0)
                    {
                        drUnitHolderInfo["CIP"] = "YES";
                    }
                    else if (string.Compare(dtHolderInfo.Rows[looper]["CIP"].ToString(), "N", true) == 0)
                    {
                        drUnitHolderInfo["CIP"] = "NO";
                    }
                }


                if (!dtHolderInfo.Rows[looper]["ID_FLAG"].Equals(DBNull.Value))
                {
                    if (string.Compare(dtHolderInfo.Rows[looper]["ID_FLAG"].ToString(), "Y", true) == 0)
                    {
                        drUnitHolderInfo["ID_FLAG"]                   = "YES";
                        drUnitHolderInfo["ID_AC"]                     = dtHolderInfo.Rows[looper]["ID_AC"].Equals(DBNull.Value) ? "" : dtHolderInfo.Rows[looper]["ID_AC"].ToString();
                        drUnitHolderInfo["ID_INTSTITUTE_NAME"]        = reportObj.getBankNameByBankCode(Convert.ToInt16(dtHolderInfo.Rows[0]["ID_BK_NM_CD"].Equals(DBNull.Value) ? "0" : dtHolderInfo.Rows[0]["ID_BK_NM_CD"].ToString())).ToString();
                        drUnitHolderInfo["ID_INTSTITUTE_BRANCH_NAME"] = reportObj.getBankBranchNameByCode(Convert.ToInt16(dtHolderInfo.Rows[0]["ID_BK_NM_CD"].Equals(DBNull.Value) ? "0" : dtHolderInfo.Rows[0]["ID_BK_NM_CD"].ToString()), Convert.ToInt16(dtHolderInfo.Rows[0]["ID_BK_BR_NM_CD"].Equals(DBNull.Value) ? "0" : dtHolderInfo.Rows[0]["ID_BK_BR_NM_CD"].ToString())).ToString();
                    }
                    else if (string.Compare(dtHolderInfo.Rows[looper]["ID_FLAG"].ToString(), "N", true) == 0)
                    {
                        drUnitHolderInfo["ID_FLAG"] = "NO";
                    }
                }



                if (!dtHolderInfo.Rows[looper]["BK_FLAG"].Equals(DBNull.Value))
                {
                    if (string.Compare(dtHolderInfo.Rows[looper]["BK_FLAG"].ToString(), "Y", true) == 0)
                    {
                        if (!dtHolderInfo.Rows[looper]["BK_NM_CD"].Equals(DBNull.Value) && !dtHolderInfo.Rows[looper]["BK_BR_NM_CD"].Equals(DBNull.Value) && !dtHolderInfo.Rows[looper]["BK_AC_NO"].Equals(DBNull.Value))
                        {
                            drUnitHolderInfo["BK_AC_NO"]       = dtHolderInfo.Rows[looper]["BK_AC_NO"].ToString();
                            drUnitHolderInfo["BANK_NAME"]      = reportObj.getBankNameByBankCode(Convert.ToInt16(dtHolderInfo.Rows[looper]["BK_NM_CD"].ToString())).ToString();
                            drUnitHolderInfo["BRANCH_NAME"]    = reportObj.getBankBranchNameByCode(Convert.ToInt16(dtHolderInfo.Rows[looper]["BK_NM_CD"].ToString()), Convert.ToInt16(dtHolderInfo.Rows[looper]["BK_BR_NM_CD"].ToString())).ToString();
                            drUnitHolderInfo["BRANCH_ADDRESS"] = reportObj.getBankBranchAddressByCode(Convert.ToInt16(dtHolderInfo.Rows[looper]["BK_NM_CD"].ToString()), Convert.ToInt16(dtHolderInfo.Rows[looper]["BK_BR_NM_CD"].ToString())).ToString();
                        }
                        else
                        {
                            string   branchAddress   = "";
                            string   BankAccInfo     = dtHolderInfo.Rows[looper]["SPEC_IN1"].ToString() + dtHolderInfo.Rows[looper]["SPEC_IN2"].ToString();
                            string[] BankAccountInfo = BankAccInfo.Split(',');
                            if (BankAccountInfo.Length > 0)
                            {
                                drUnitHolderInfo["BK_AC_NO"] = BankAccountInfo[0].ToString();
                                if (BankAccountInfo.Length > 1)
                                {
                                    drUnitHolderInfo["BANK_NAME"] = BankAccountInfo[1].ToString();
                                }
                                if (BankAccountInfo.Length > 2)
                                {
                                    drUnitHolderInfo["BRANCH_NAME"] = BankAccountInfo[2].ToString();
                                }
                                if (BankAccountInfo.Length > 3)
                                {
                                    for (int loop = 3; loop < BankAccountInfo.Length; loop++)
                                    {
                                        branchAddress = branchAddress + BankAccountInfo[loop].ToString();
                                    }
                                    drUnitHolderInfo["BRANCH_ADDRESS"] = branchAddress;
                                }
                            }
                        }
                    }
                }


                DataTable dtNominee = reportObj.dtNominee(dtHolderInfo.Rows[looper]["REG_BK"].ToString(), dtHolderInfo.Rows[looper]["REG_BR"].ToString(), Convert.ToInt32(dtHolderInfo.Rows[looper]["R_NO"].ToString()));
                if (dtNominee.Rows.Count > 0)
                {
                    for (int loop = 0; loop < dtNominee.Rows.Count; loop++)
                    {
                        if (Convert.ToInt16(dtNominee.Rows[loop]["NOMI_NO"].ToString()) == 1)
                        {
                            drUnitHolderInfo["NOMI_CTL_NO"]       = dtNominee.Rows[loop]["NOMI_CTL_NO"].Equals(DBNull.Value) ? "" : dtNominee.Rows[loop]["NOMI_CTL_NO"].ToString();
                            drUnitHolderInfo["NOMI1_NAME"]        = dtNominee.Rows[loop]["NOMI_NAME"].Equals(DBNull.Value) ? "" : dtNominee.Rows[loop]["NOMI_NAME"].ToString();
                            drUnitHolderInfo["NOMI1_FMH_NAME"]    = dtNominee.Rows[loop]["NOMI_FMH_NAME"].Equals(DBNull.Value) ? "" : dtNominee.Rows[loop]["NOMI_FMH_NAME"].ToString();
                            drUnitHolderInfo["NOMI1_OCC_CODE"]    = dtNominee.Rows[loop]["DESCR"].Equals(DBNull.Value) ? "" : dtNominee.Rows[loop]["DESCR"].ToString();
                            drUnitHolderInfo["NOMI1_ADDRS1"]      = dtNominee.Rows[loop]["NOMI_ADDRS1"].Equals(DBNull.Value) ? "" : dtNominee.Rows[loop]["NOMI_ADDRS1"].ToString();
                            drUnitHolderInfo["NOMI1_ADDRS2"]      = dtNominee.Rows[loop]["NOMI_ADDRS2"].Equals(DBNull.Value) ? "" : dtNominee.Rows[loop]["NOMI_ADDRS2"].ToString();
                            drUnitHolderInfo["NOMI1_CITY"]        = dtNominee.Rows[loop]["NOMI_CITY"].Equals(DBNull.Value) ? "" : dtNominee.Rows[loop]["NOMI_CITY"].ToString();
                            drUnitHolderInfo["NOMI1_NATIONALITY"] = dtNominee.Rows[loop]["NOMI_NATIONALITY"].Equals(DBNull.Value) ? "" : dtNominee.Rows[loop]["NOMI_NATIONALITY"].ToString();
                            drUnitHolderInfo["NOMI1_NOMI_REL"]    = dtNominee.Rows[loop]["NOMI_REL"].Equals(DBNull.Value) ? "" : dtNominee.Rows[loop]["NOMI_REL"].ToString();
                            drUnitHolderInfo["NOMI1_PERCENTAGE"]  = dtNominee.Rows[loop]["PERCENTAGE"].Equals(DBNull.Value) ? "" : dtNominee.Rows[loop]["PERCENTAGE"].ToString();
                        }
                        else if (Convert.ToInt16(dtNominee.Rows[loop]["NOMI_NO"].ToString()) == 2)
                        {
                            drUnitHolderInfo["NOMI2_NAME"]        = dtNominee.Rows[loop]["NOMI_NAME"].Equals(DBNull.Value) ? "" : dtNominee.Rows[loop]["NOMI_NAME"].ToString();
                            drUnitHolderInfo["NOMI2_FMH_NAME"]    = dtNominee.Rows[loop]["NOMI_FMH_NAME"].Equals(DBNull.Value) ? "" : dtNominee.Rows[loop]["NOMI_FMH_NAME"].ToString();
                            drUnitHolderInfo["NOMI2_OCC_CODE"]    = dtNominee.Rows[loop]["DESCR"].Equals(DBNull.Value) ? "" : dtNominee.Rows[loop]["DESCR"].ToString();
                            drUnitHolderInfo["NOMI2_ADDRS1"]      = dtNominee.Rows[loop]["NOMI_ADDRS1"].Equals(DBNull.Value) ? "" : dtNominee.Rows[loop]["NOMI_ADDRS1"].ToString();
                            drUnitHolderInfo["NOMI2_ADDRS2"]      = dtNominee.Rows[loop]["NOMI_ADDRS2"].Equals(DBNull.Value) ? "" : dtNominee.Rows[loop]["NOMI_ADDRS2"].ToString();
                            drUnitHolderInfo["NOMI2_CITY"]        = dtNominee.Rows[loop]["NOMI_CITY"].Equals(DBNull.Value) ? "" : dtNominee.Rows[loop]["NOMI_CITY"].ToString();
                            drUnitHolderInfo["NOMI2_NATIONALITY"] = dtNominee.Rows[loop]["NOMI_NATIONALITY"].Equals(DBNull.Value) ? "" : dtNominee.Rows[loop]["NOMI_NATIONALITY"].ToString();
                            drUnitHolderInfo["NOMI2_NOMI_REL"]    = dtNominee.Rows[loop]["NOMI_REL"].Equals(DBNull.Value) ? "" : dtNominee.Rows[loop]["NOMI_REL"].ToString();
                            drUnitHolderInfo["NOMI2_PERCENTAGE"]  = dtNominee.Rows[loop]["PERCENTAGE"].Equals(DBNull.Value) ? "" : dtNominee.Rows[loop]["PERCENTAGE"].ToString();
                        }
                    }
                }
                dtUnitHolderInfo.Rows.Add(drUnitHolderInfo);
            }

            // dtUnitHolderInfo.WriteXmlSchema(@"D:\Project\Web\AMCL.OPENMF\AMCL.Web\UI\ReportViewer\Report\dtUnitHolderInfo.xsd");


            string Path = Server.MapPath("Report/rptRegHolderInfo.rpt");
            rdoc.Load(Path);
            rdoc.SetDataSource(dtUnitHolderInfo);
            CrystalReportViewer1.ReportSource = rdoc;
            rdoc.SetParameterValue("fundName", opendMFDAO.GetFundName(fundCode.ToString()));
            rdoc = ReportFactory.GetReport(rdoc.GetType());
        }
        else
        {
            Response.Write("No data found");
        }
    }