Esempio n. 1
0
        private static void GeneratePPIdentificationTitulaire(FoxitPDFGenerator pdfGen, Upsilab.Data.Model.CustomerProspect customerProspect, Upsilab.Data.Model.Report report, ref float y,bool pIsEmptyReport)
        {
            var languageDataPM = PageLanguageHelper.GetLanguageContent("User", "PDF_PM_Report");
            var languageDataPP = PageLanguageHelper.GetLanguageContent("User", "PDFReportPP");
            var languageData = PageLanguageHelper.GetLanguageContent("User", "ClientPP_Titulaire");
            var languageDataPatFin = PageLanguageHelper.GetLanguageContent("User", "ClientPP_ParimoineFinancier");
            pdfGen.CreatePage();
            pdfGen.AddTitle(languageDataPP.GetContent("PdfReportPP_038"), y, max_width, 20);//IDENTIFICATION DU TITULAIRE",

            float x = 0;

            #region I. Identité

            x += 20;
            pdfGen.AddSubtitle(string.Format("I. {0}", languageDataPP.GetContent("PdfReportPP_244").Replace("I.",string.Empty)), y += interline * 1.5f, max_width, height, x);//I. Identité

            /*--------------------------------------------- FIX ISSUE 9985 ----------------------------- */
            #region II Origine de la relation (Become n°I fix issue 9985)

            var repoClientNew = GetReportOptionValueByIdOption(232, report);
            ReportBL.PlotBooleanValue(pdfGen, repoClientNew, y += paddingAfterParagraph, x);
            pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_276"), y += CheckBoxPosition, 130, height, x += 15);

            var repoClientDepuis = GetReportOptionValueByIdOption(233, report);
            x += AbscisseRef;
            ReportBL.PlotBooleanValue(pdfGen, repoClientDepuis, y -= CheckBoxPosition, x);
            string dateOrigineDeLaRelation = GetReportOptionAttributeValueByIdOptionAttribute(158, report);
            pdfGen.AddDefaultText(string.Format(languageDataPP.GetContent("PdfReportPP_277"), string.Empty), y += CheckBoxPosition, 250, height, x += 15);
            pdfGen.AddAnswer(dateOrigineDeLaRelation, y, (307 * 31 / 50), 20, x += 60);


            //Contact par recommandation
            y += textInterline * 1.5f;
            pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_280"), y, max_width, height);


            string libelle = string.Empty;
            var tab = new int[] { 1194, 247, 248, 249, 250, 251, 252, 253 };
            var tablib = new string[] { "PdfReportPP_2801", "PdfReportPP_281", "PdfReportPP_282", "PdfReportPP_283", "PdfReportPP_284", "PdfReportPP_285", "PdfReportPP_286", "PdfReportPP_287" };
            for (var i = 0; i < tab.Length; i++)
            {
                var rOpValue = GetReportOptionValueByIdOption(tab[i], report);
                if (rOpValue != null)
                {
                    if (tab[i] != 253) libelle = languageDataPP.GetContent(tablib[i]);
                    else libelle = GetStringValue(GetReportOptionAttributeValueByIdOptionAttribute(159, report));
                    break;
                }
            }
            pdfGen.AddAnswer(libelle, y, 350, height, 130);

            y += textInterline * 2f;

            /*--------------------------------------------- FIX ISSUE 9985 ----------------------------- */

            #endregion

            #region "IDENTITE DU TITULAIRE"
            // civilité
            x = 0;
            pdfGen.AddDefaultText(LanguageContentBL.Translate("ClientPP_Titulaire_1219"), y, max_width, height, x);
            x = height + 40;

            ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(1220, report), y, x);
            pdfGen.AddDefaultText(LanguageContentBL.Translate("ClientPP_Titulaire_1220"), y += CheckBoxPosition, max_width, height, x = x + tabCheck);//Monsieur
            ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(1221, report), y -= CheckBoxPosition, x = x + tabCheck + 40);
            pdfGen.AddDefaultText(LanguageContentBL.Translate("ClientPP_Titulaire_1221"), y += CheckBoxPosition, max_width, height, x = x + tabCheck);//Madame
            ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(1222, report), y -= CheckBoxPosition, x = x + tabCheck + 40);
            pdfGen.AddDefaultText(LanguageContentBL.Translate("ClientPP_Titulaire_1222"), y += CheckBoxPosition, max_width, height, x = x + tabCheck);//Mademoiselle

            // Nom
            x = 20;
            y += interline /*+ 5*/;
            string nom = string.Format(languageDataPP.GetContent("PdfReportPP_245"), string.Empty);
            string nomV = GetReportOptionAttributeValueByIdOptionAttribute(142, report);

            //Prénom
            x = 240;
            string prenom = string.Format(languageDataPP.GetContent("PdfReportPP_246"), string.Empty);
            string prenomV = GetReportOptionAttributeValueByIdOptionAttribute(143, report);

            GenerateDoubleColonne(pdfGen, nom, nomV, prenom, prenomV, ref y);

            y += interline/* + 5*/;
            // Nom de jeune fille
            string nomJeuneFille = String.Format(languageDataPP.GetContent("PdfReportPP_247"), string.Empty);
            string nomJeuneFilleV = GetReportOptionAttributeValueByIdOptionAttribute(144, report);

            x = 0;
            const float LNPX = 225;
            //float lnpx1 = pdfGen.GetWidthOfString(nomJeuneFille);
            float lnpx1 = LNPX;
            float wdth1 = lnpx1 * 31 / 50;
            float wdthAnswer = 500 - (10 + wdth1);
            pdfGen.AddDefaultText(nomJeuneFille, y, label_width, height, x);
            pdfGen.AddAnswer(nomJeuneFilleV, y, wdthAnswer, 20, x += 135);

            // Date de naissance
            y += interline /*+ 5*/;
            string dateNaissance = String.Format(languageDataPP.GetContent("PdfReportPP_248"), string.Empty);
            string dateNaissanceV = GetReportOptionAttributeValueByIdOptionAttribute(145, report);

            // Lieu de naissance
            string lieuNaissance = String.Format(languageDataPP.GetContent("PdfReportPP_249"), string.Empty);
            string lieuNaissanceV = GetReportOptionAttributeValueByIdOptionAttribute(147, report);

            GenerateDoubleColonne(pdfGen, dateNaissance, dateNaissanceV, lieuNaissance, lieuNaissanceV, ref y);

            string hostCode = Upsilab.Business.Utility.SessionManager.GetHostCodeSession();
            if (!string.IsNullOrEmpty(hostCode) && hostCode == "BE")
            {
                y += interline/* + 5*/;

                string numRegNat = String.Format(languageDataPP.GetContent("PdfReportPP_NumReg"), string.Empty);
                string numRegNatV = GetReportOptionAttributeValueByIdOptionAttribute(772, report);

                x = 0;
                // float lnpx2 = pdfGen.GetWidthOfString(numRegNat);
                float lnpx2 = LNPX;
                float wdth2 = lnpx2 * 31 / 50;
                float wdth2nswer = 490 - (10 + wdth2);
                pdfGen.AddDefaultText(numRegNat, y, label_width, height, x);
                pdfGen.AddAnswer(numRegNatV, y, wdth2nswer, 20, x += 135);
            }

            // Tél privé
            y += interline/* + 5*/;
            string telPrive = String.Format(languageDataPP.GetContent("PdfReportPP_250"), string.Empty);
            string telPriveV = GetReportOptionAttributeValueByIdOptionAttribute(148, report);

            // Tél prof
            string telProf = String.Format(languageDataPP.GetContent("PdfReportPP_252"), string.Empty);
            string telProfV = GetReportOptionAttributeValueByIdOptionAttribute(150, report);

            GenerateDoubleColonne(pdfGen, telPrive, telPriveV, telProf, telProfV, ref y);

            // Tél port
            y += interline/* + 5*/;
            string telPort = String.Format(languageDataPP.GetContent("PdfReportPP_253"), string.Empty);
            string telPortV = GetReportOptionAttributeValueByIdOptionAttribute(151, report);

            // addresse e-mail
            string email = String.Format(languageDataPP.GetContent("PdfReportPP_254"), string.Empty);
            string emailV = GetReportOptionAttributeValueByIdOptionAttribute(152, report);

            GenerateDoubleColonne(pdfGen, telPort, telPortV, email, emailV, ref y);


            // addresse courrier
            x = 0;
            y += interline/* + 5*/;
            string adCour = String.Format(languageDataPP.GetContent("PdfReportPP_255"), string.Empty);
            string adCourV = GetReportOptionAttributeValueByIdOptionAttribute(153, report);

            //            float lnpx4 = pdfGen.GetWidthOfString(adCour);
            float lnpx4 = LNPX;
            float wdth4 = lnpx4 * 31 / 50;
            float wdth4nswer = 500 - (10 + wdth4);
            pdfGen.AddDefaultText(adCour, y, label_width, height, x);            
            //pdfGen.AddAnswer(adCourV, y, wdth4nswer, height * 3, x += 135);
            y = pdfGen.AddMultiLineAnswer(adCourV, y, wdth4nswer, height * 3, x += 135);
            //**[06_01_2016]**pdfGen.AddBlueLine(y-10, wdth4nswer, 1.3f, 135); 

            // code postale
            y += interline/* + 5*/;
            string codePostale = String.Format(languageDataPP.GetContent("PdfReportPP_256"), string.Empty);
            string codePostaleV = GetReportOptionAttributeValueByIdOptionAttribute(539, report);

            // ville
            string ville = String.Format(languageDataPP.GetContent("PdfReportPP_257"), string.Empty);
            string villeV = GetReportOptionAttributeValueByIdOptionAttribute(540, report);

            GenerateDoubleColonne(pdfGen, codePostale, codePostaleV, ville, villeV, ref y);

            // adresse fiscale
            y += interline/* + 5*/;
            x = 0;
            string adfisc = String.Format(languageDataPP.GetContent("PdfReportPP_258"), string.Empty);
            string adfiscV = GetReportOptionAttributeValueByIdOptionAttribute(154, report);

            //float lnpx5 = pdfGen.GetWidthOfString(adfisc);
            float lnpx5 = LNPX;
            float wdth5 = lnpx5 * 31 / 50;
            float wdth5nswer = 490 - (10 + wdth5);
            pdfGen.AddDefaultText(adfisc, y, label_width, height, x);
            //pdfGen.AddAnswer(adfiscV, y, wdth5nswer, height * 3, x += 135);
            y = pdfGen.AddMultiLineAnswer(adfiscV, y, wdth5nswer, height * 3, x += 145);


            // code postale
            y += interline/* + 5*/;
            string cPostal = String.Format(languageDataPP.GetContent("PdfReportPP_259"), string.Empty);
            string cPostalV = GetReportOptionAttributeValueByIdOptionAttribute(541, report);

            // ville
            string vil = String.Format(languageDataPP.GetContent("PdfReportPP_260"), string.Empty);
            string vilV = GetReportOptionAttributeValueByIdOptionAttribute(542, report);

            GenerateDoubleColonne(pdfGen, cPostal, cPostalV, vil, vilV, ref y);

            //Etes vous ?
            pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_261"), y += paddingAfterParagraph, max_width, height);

            if (Upsilab.Business.Utility.ConfigurationManager.ExtranetHostCode == Upsilab.Business.Language.LanguageContentBL.HostCode.FR.ToString())
            {

                x = 77;
                /* fix issue 9985 */
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(218, report), y -= CheckBoxPosition, x);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_262"), y += CheckBoxPosition, 200, 20, x += tabCheck);
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(219, report), y -= CheckBoxPosition, x += 130/*answer_x*/);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_263"), y += CheckBoxPosition, 400, height, x += tabCheck);
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(220, report), y -= CheckBoxPosition, x += 130);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_264"), y += CheckBoxPosition, 200, height, x += tabCheck);

                x = 77;
                y += interline;
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(221, report), y -= CheckBoxPosition, x);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_265"), y += CheckBoxPosition, 200, height, x += tabCheck);
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByNamekey("ClientPP_Titulaire_022_Mineur", report), y -= CheckBoxPosition, x += 130);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_266"), y += CheckBoxPosition, 200, 20, x += tabCheck);
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(1149, report), y -= CheckBoxPosition, x += 130);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_486"), y += CheckBoxPosition, 200, 20, x += tabCheck);
            }
            else
            {

                /* fix issue 9985 */
                x = 77;
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(218, report), y -= CheckBoxPosition, x);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_262"), y += CheckBoxPosition, 200, 20, x += tabCheck);
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(1255, report), y -= CheckBoxPosition, x+=130);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_Majeur_Incapable"), y += CheckBoxPosition, 200, 20, x += tabCheck);
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByNamekey("ClientPP_Titulaire_022_Mineur", report), y -= CheckBoxPosition, x += 130);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_266"), y += CheckBoxPosition, 200, 20, x + tabCheck);

                x = 77;
                y += interline;
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(1149, report), y -= CheckBoxPosition, x);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_486"), y += CheckBoxPosition, 200, 20, x += tabCheck);
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(218, report), y -= CheckBoxPosition, x +=130);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_262"), y += CheckBoxPosition, 400, 20, x += tabCheck);
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(1255, report), y -= CheckBoxPosition, x += 130);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_Majeur_Incapable"), y += CheckBoxPosition, 200, 20, x += tabCheck);
            }

            //Representant legal
            y += interline;
            string repLegal = String.Format(languageDataPP.GetContent("PdfReportPP_487"), string.Empty);
            string repLegalV = GetReportOptionAttributeValueByIdOptionAttribute(739, report);

            //Nationalite
            string nationalite = String.Format(languageDataPP.GetContent("PdfReportPP_267"), string.Empty);
            string nationaliteV = GetReportOptionAttributeValueByIdOptionAttribute(155, report);

            GenerateDoubleColonne(pdfGen, repLegal, repLegalV, nationalite, nationaliteV, ref y);

            //Auter nationalite
            x = 0;
            y += interline/* + 5*/;
            string oNationalite = String.Format(languageDataPP.GetContent("PdfReportPP_268"), string.Empty);
            string oNationaliteV = GetReportOptionAttributeValueByIdOptionAttribute(156, report);

            //float lnpx6 = pdfGen.GetWidthOfString(oNationalite);
            float lnpx6 = LNPX;
            float wdth6 = lnpx6 * 31 / 50;
            float wdth6nswer = 490 - (10 + wdth6);
            pdfGen.AddDefaultText(oNationalite, y, label_width, height, x);
            pdfGen.AddAnswer(oNationaliteV, y, wdth6nswer, 20, x += 135);

            #region RESIDENT


            //Resident
            ReportOptionValue residentReport = GetReportOptionValueByIdOption(223, report);
            x = 0;
            y += interline + 3;

            float lnpx9 = LNPX;
            float wdth9 = lnpx9 * 31 / 50;
            float wdth9nswer = 240 - (10 + wdth9);
            pdfGen.AddDefaultText(string.Format("{0} :", languageDataPP.GetContent("PdfReportPP_269")), y, label_width, height, x);
            ReportBL.PlotBooleanValue(pdfGen, residentReport, y -= CheckBoxPosition, x += 89);
            pdfGen.AddDefaultText(languageData.GetContent("ClientPP_Titulaire_030"), y += CheckBoxPosition, 200, height, x += tabCheck);
            ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(224, report), y -= CheckBoxPosition, x += tabYesNo * 1.5f);
            pdfGen.AddDefaultText(languageData.GetContent("ClientPP_Titulaire_031"), y += CheckBoxPosition, 200, height, x += tabCheck);

            string pays = GetReportOptionAttributeValueByIdOptionAttribute(157, report);
            if (residentReport != null && string.IsNullOrEmpty(pays))
            {
                pays = languageDataPP.GetContent("Country_Enum_064");
            }

            // Pays de residence
            string paysres = String.Format(languageDataPP.GetContent("PdfReportPP_271"), string.Empty);

            // colonne B
            //float lnpx7 = pdfGen.GetWidthOfString(paysres);
            float lnpx7 = LNPX;
            float wdth7 = lnpx7 * 31 / 50;
            float wdth7nswer = 240 - (10 + wdth7);

            x = 250;
            pdfGen.AddDefaultText(paysres, y, label_width, height, x);
            pdfGen.AddAnswer(pays, y, wdth7nswer, 20, x += 135);

            #endregion 
            #endregion

            #region "CONJOINT"
            y += interline * 1.5f;
            x = 0;
            // Le client a-t-il un(e) conjoint(e)?
            string conjoint = languageData.GetContent("ClientPP_Titulaire_conjoint_290");
            float lnpxCjt = pdfGen.GetWidthOfString(conjoint);
            float wdthCjt = lnpxCjt * 31 / 50;
            wdthCjt = wdthCjt <= 100 ? 100 : 100 + (wdthCjt/10);
            pdfGen.AddDefaultTextWithAutomaticNewPage(conjoint, ref y, max_width, x);

            var reportConjointOui = GetReportOptionValueByIdOption(1304, report);
            var optConjointOui = OptionBL.GetOptionLiteById(1304);
            ReportBL.PlotBooleanValueWithAutomaticNewPage(pdfGen, reportConjointOui, ref y, x += tabCheck + wdthCjt);
            pdfGen.AddDefaultTextWithAutomaticNewPage(languageDataPatFin.GetContent(optConjointOui.NameKey), ref y, max_width, height, x += tabCheck);
            var optConjointNon = OptionBL.GetOptionLiteById(1305);
            ReportBL.PlotBooleanValueWithAutomaticNewPage(pdfGen, GetReportOptionValueByIdOption(1305, report), ref y, x += tabCheck + 30);
            pdfGen.AddDefaultTextWithAutomaticNewPage(languageDataPatFin.GetContent(optConjointNon.NameKey), ref y, max_width, height, x += tabCheck);


            if (reportConjointOui != null || pIsEmptyReport)
            {
                // civilité
                y += interline/* +5*/;
                x = 0;
                pdfGen.AddDefaultTextWithAutomaticNewPage(LanguageContentBL.Translate("ClientPP_Titulaire_1223"), ref y, max_width, height, x);
                x = height + 40;

                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(1224, report), y, x);
                pdfGen.AddDefaultText(LanguageContentBL.Translate("ClientPP_Titulaire_1224"), y += CheckBoxPosition, max_width, height, x = x + tabCheck);//Monsieur
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(1225, report), y -= CheckBoxPosition, x = x + tabCheck + 40);
                pdfGen.AddDefaultText(LanguageContentBL.Translate("ClientPP_Titulaire_1225"), y += CheckBoxPosition, max_width, height, x = x + tabCheck);//Madame
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(1225, report), y -= CheckBoxPosition, x = x + tabCheck + 40);
                pdfGen.AddDefaultText(LanguageContentBL.Translate("ClientPP_Titulaire_1226"), y += CheckBoxPosition, max_width, height, x = x + tabCheck);//Mademoiselle

                
                // Nom conjoint
                y += interline;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, height);
                string nomCjt = String.Format(languageDataPP.GetContent("PdfReportPP_245"), string.Empty);
                string nomCjtV = GetReportOptionAttributeValueByIdOptionAttribute(180, report);
                
                // prénom conjoint
                string prenomCjt = String.Format(languageDataPP.GetContent("PdfReportPP_246"), string.Empty);
                string prenomCjtV = GetReportOptionAttributeValueByIdOptionAttribute(182, report);
                 GenerateDoubleColonne(pdfGen,nomCjt,nomCjtV,prenomCjt,prenomCjtV, ref y);

                // Nom de jeune fille conjoint
                y += interline + 5;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, height);
                string nomJeuneFilleCjt = String.Format(languageDataPP.GetContent("PdfReportPP_247"), string.Empty);
                string nomJeuneFilleCjtV = GetReportOptionAttributeValueByIdOptionAttribute(181, report);
                x = 0;
                float wdthNjf = LNPX * 31 / 50;
                float wdthNjfnswer = 500 - (10 + wdthNjf);
                pdfGen.AddDefaultText(nomJeuneFilleCjt, y, label_width, height, x);
                pdfGen.AddAnswer(nomJeuneFilleCjtV, y, wdthNjfnswer, 20, x += 135);

                // Date de naissance
                y += interline;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, height);
                string dateNaissanceCjt = String.Format(languageDataPP.GetContent("PdfReportPP_248"), string.Empty);
                string dateNaissanceCjtV = GetReportOptionAttributeValueByIdOptionAttribute(183, report);

                // Lieu de naissance
                string lieuNaissanceCjt = String.Format(languageDataPP.GetContent("PdfReportPP_249"), string.Empty);
                string lieuNaissanceCjtV = GetReportOptionAttributeValueByNamekey("ClientPP_Titulaire_187", report);

                GenerateDoubleColonne(pdfGen, dateNaissanceCjt, dateNaissanceCjtV, lieuNaissanceCjt, lieuNaissanceCjtV, ref y);

                if (!string.IsNullOrEmpty(hostCode) && hostCode == "BE")
                {
                    y += interline;
                    pdfGen.CalculeZoneWithAutomaticNewPage(ref y, height);
                    string numRegNatCjt = String.Format(languageDataPP.GetContent("PdfReportPP_NumReg"), string.Empty);
                    string numRegNatCjtV = GetReportOptionAttributeValueByIdOptionAttribute(773, report);
                    pdfGen.AddDefaultText(numRegNatCjt, y, label_width, height, x);
                    pdfGen.AddAnswer(numRegNatCjtV, y, wdthNjfnswer, 20, x += 135);
                }

                // Tél privé
                y += interline;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, height);
                string telPrivCjt = String.Format(languageDataPP.GetContent("PdfReportPP_250"), string.Empty);
                string telPrivCjtV = GetReportOptionAttributeValueByIdOptionAttribute(897, report);


                // Tél prof
                string telProfCjt = String.Format(languageDataPP.GetContent("PdfReportPP_252"), string.Empty);
                string telProfCjtV = GetReportOptionAttributeValueByIdOptionAttribute(184, report);

                GenerateDoubleColonne(pdfGen, telPrivCjt, telPrivCjtV, telProfCjt, telProfCjtV, ref y);

                y += interline;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, 2.5f*height);
                // Tél port
                string telPortCjt = String.Format(languageDataPP.GetContent("PdfReportPP_253"), string.Empty);
                string telPortCjtV = GetReportOptionAttributeValueByIdOptionAttribute(185, report);

                // addresse e-mail
                string emailCjt = String.Format(languageDataPP.GetContent("PdfReportPP_254"), string.Empty);
                string emailCjtV = GetReportOptionAttributeValueByIdOptionAttribute(186, report);

                GenerateDoubleColonne(pdfGen, telPortCjt, telPortCjtV, emailCjt, emailCjtV, ref y);

                // addresse courrier
                x = 0;
                y += interline;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, 3 * height);
                string adCourCjt = String.Format(languageDataPP.GetContent("PdfReportPP_255"), string.Empty);
                string adCourCjtV = GetReportOptionAttributeValueByIdOptionAttribute(187, report);

                lnpx4 = LNPX;
                wdth4 = lnpx4 * 31 / 50;
                wdth4nswer = 500 - (10 + wdth4);
                pdfGen.AddDefaultText(adCourCjt, y, label_width, height, x);
                y = pdfGen.AddMultiLineAnswer(adCourCjtV, y, wdth4nswer, height * 3, x += 135);

                // code postale
                y += interline;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, 2.5f * height);
                string codePostaleCjt = String.Format(languageDataPP.GetContent("PdfReportPP_256"), string.Empty);
                string codePostaleCjtV = GetReportOptionAttributeValueByIdOptionAttribute(898, report);

                // ville
                string villeCjt = String.Format(languageDataPP.GetContent("PdfReportPP_257"), string.Empty);
                string villeCjtV = GetReportOptionAttributeValueByIdOptionAttribute(899, report);

                GenerateDoubleColonne(pdfGen, codePostaleCjt, codePostaleCjtV, villeCjt, villeCjtV, ref y);

                // adresse fiscale
                y += interline;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, 3 * height);
                x = 0;
                string adfiscCjt = String.Format(languageDataPP.GetContent("PdfReportPP_258"), string.Empty);
                string adfiscCjtV = GetReportOptionAttributeValueByIdOptionAttribute(900, report);

                lnpx5 = LNPX;
                wdth5 = lnpx5 * 31 / 50;
                wdth5nswer = 490 - (10 + wdth5);
                pdfGen.AddDefaultText(adfiscCjt, y, label_width, height, x);
                y = pdfGen.AddMultiLineAnswer(adfiscCjtV, y, wdth5nswer, height * 3, x += 145);

                // code postale
                y += interline;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, 2.5f * height);
                string cPostalCjt = String.Format(languageDataPP.GetContent("PdfReportPP_259"), string.Empty);
                string cPostalCjtV = GetReportOptionAttributeValueByIdOptionAttribute(901, report);

                // ville
                string vilCjt = String.Format(languageDataPP.GetContent("PdfReportPP_260"), string.Empty);
                string vilCjtV = GetReportOptionAttributeValueByIdOptionAttribute(902, report);

                GenerateDoubleColonne(pdfGen, cPostalCjt, cPostalCjtV, vilCjt, vilCjtV, ref y);

                // Votre conjoint est-il

                y += (interline*2f);
                var yTmp = y;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, 2*height);
                if (y > 0)
                    y = yTmp;
                pdfGen.AddDefaultTextWithAutomaticNewPage(languageDataPP.GetContent("PdfReportPP_sit_conj"), ref y, max_width, height);

                if (Upsilab.Business.Utility.ConfigurationManager.ExtranetHostCode == Upsilab.Business.Language.LanguageContentBL.HostCode.FR.ToString())
                {
                    x = 77;
                    ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(1152, report), y -= CheckBoxPosition, x);
                    pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_262"), y += CheckBoxPosition, 200, height, x += tabCheck);
                    ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(1153, report), y -= CheckBoxPosition, x += 130);
                    pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_263"), y += CheckBoxPosition, 200, height, x += tabCheck);
                    ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(1154, report), y -= CheckBoxPosition, x += 130);
                    pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_264"), y += CheckBoxPosition, 200, height, x += tabCheck);

                    x = 77;
                    y += interline;
                    ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(1155, report), y -= CheckBoxPosition, x);
                    pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_265"), y += CheckBoxPosition, 200, height, x += tabCheck);
                    ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(1156, report), y -= CheckBoxPosition, x += 130);
                    pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_266"), y += CheckBoxPosition, 200, 20, x += tabCheck);
                    ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(1157, report), y -= CheckBoxPosition, x += 130);
                    pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_486"), y += CheckBoxPosition, 200, 20, x += tabCheck);
                }
                else
                {
                    x = 77;
                    ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(1152, report), y /*= y + interline*/, x);
                    pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_262"), y += CheckBoxPosition, 400, 20, x += tabCheck);
                    ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(1256, report), y -= CheckBoxPosition, x += answer_x);
                    pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_Majeur_Incapable"), y += CheckBoxPosition, 200, 20, x += tabCheck);

                    x = 77;
                    ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(1156, report), y = y + interline, x);
                    pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_266"), y += CheckBoxPosition, 200, 20, x += tabCheck);
                    ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(1157, report), y -= CheckBoxPosition, x += answer_x);
                    pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_486"), y += CheckBoxPosition, 200, 20, x += tabCheck);

                }

                // profession
                y += interline;
                yTmp = y;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, height);
                if (y > 0) y = yTmp;
                string profession = String.Format(languageDataPP.GetContent("PdfReportPP_353"), string.Empty);
                string professionV = GetReportOptionAttributeValueByIdOptionAttribute(188, report);

                // statut sociale
                //string statutSociale = String.Format(languageDataPP.GetContent("PdfReportPP_354"), string.Empty);
                //string statutSocialeV = GetReportOptionAttributeValueByIdOptionAttribute(189, report);

                //Nationalite
                string nationaliteCjt = String.Format(languageDataPP.GetContent("PdfReportPP_267"), string.Empty);
                string nationaliteCjtV = GetReportOptionAttributeValueByIdOptionAttribute(190, report);

                GenerateDoubleColonne(pdfGen, profession, professionV, nationaliteCjt, nationaliteCjtV, ref y);


                // autre nationalité
                y += interline;
                yTmp = y;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, height);
                if (y > 0) y = yTmp;
                string oNationaliteCjt = String.Format(languageDataPP.GetContent("PdfReportPP_268"), string.Empty);
                string oNationaliteCjtV = GetReportOptionAttributeValueByNamekey("ClientPP_Titulaire_188", report);

                Func<string, string, string, string, float,string> GenerateDoubleColonneDelegate = (colonneATitleDlg, colonneAValueDlg, colonneBTitleDlg, colonneBValueDlg,y1) =>
                {
                    x = 0;
                    const float maxColWidth = 240;
                    float lnpxAA = 150, lnpxBB = 162;
                    float wdthAA = lnpxAA * 31 / 50;
                    float wdthAAnswer = maxColWidth - (10 + wdthAA);
                    float wdthBB = lnpxBB * 31 / 50;
                    float wdthBBnswer = maxColWidth - (10 + wdthBB);

                    pdfGen.AddDefaultText(colonneATitleDlg, y1, label_width, height, x);
                    pdfGen.AddAnswer(colonneAValueDlg, y1, wdthAAnswer, 20, x += 89);

                    x = 250;
                    pdfGen.AddDefaultText(colonneBTitleDlg, y1, label_width, height, x);
                    pdfGen.AddAnswer(colonneBValueDlg, y1, wdthBBnswer, 20, x += 110);
                    return string.Empty;
                };

                GenerateDoubleColonneDelegate(nationaliteCjt, nationaliteCjtV, oNationaliteCjt, oNationaliteCjtV,y);

                // résident
                x = 0;
                y += interline + 3;
                yTmp = y;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, height);
                pdfGen.AddDefaultText(string.Format("{0} :", languageDataPP.GetContent("PdfReportPP_269")), y, label_width, height, x);
                var residentConjointReport = GetReportOptionValueByNamekey("ClientPP_Titulaire_167", report);
                ReportBL.PlotBooleanValue(pdfGen, residentConjointReport, y -= CheckBoxPosition, x += 89);
                pdfGen.AddDefaultText(languageData.GetContent("ClientPP_Titulaire_030"), y += CheckBoxPosition, 200, height, x += tabCheck);
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByNamekey("ClientPP_Titulaire_168", report), y -= CheckBoxPosition, x += tabYesNo * 1.5f);
                pdfGen.AddDefaultText(languageData.GetContent("ClientPP_Titulaire_031"), y += CheckBoxPosition, 200, height, x += tabCheck);

                string paysConjoint = GetReportOptionAttributeValueByNamekey("ClientPP_Titulaire_169", report);
                if (residentConjointReport != null && string.IsNullOrEmpty(paysConjoint))
                    paysConjoint = languageDataPP.GetContent("Country_Enum_064");

                x = 250;
                pdfGen.AddDefaultText(String.Format(languageDataPP.GetContent("PdfReportPP_271"), string.Empty), y, label_width, height, x);
                pdfGen.AddAnswer(paysConjoint, y, 130, 20, x += 110);

            }

            #endregion
            #endregion

            #region II. Vie professionnelle

            bool isretraite = false;
            bool is2libeormore = false;

            y += interline * 2f;
            x = 20;
            pdfGen.AddSubtitleWithAutomaticNewPage(string.Format("II. {0}", languageDataPP.GetContent("PdfReportPP_297").Replace("IV.", string.Empty)), ref y, max_width, height, x);

            y += interline;
            x = 0;

            // En activités
            var enactivites = languageData.GetContent("ClientPP_Titulaire_enactivites");
            var enactivitesV = GetReportOptionValueByIdOption(261, report);

            // retraités
            var retraites = languageData.GetContent("ClientPP_Titulaire_retraites");
            var retraitesV = GetReportOptionValueByIdOption(263, report);

            // Sans activités
            var sansactivites = languageData.GetContent("ClientPP_Titulaire_sansactivites");
            var sansactivitesV = GetReportOptionValueByIdOption(259, report);

            // Autres activites
            var autresactivites = languageData.GetContent("ClientPP_Titulaire_autresactivites");
            var autresactivitesV = GetReportOptionValueByIdOption(262, report);

            ReportBL.PlotBooleanValue(pdfGen, enactivitesV, y += 10, x);
            pdfGen.AddDefaultText(enactivites, y += CheckBoxPosition, 200, height, x += tabCheck);

            ReportBL.PlotBooleanValue(pdfGen, retraitesV, y -= CheckBoxPosition, x += tabCheck + 50);
            pdfGen.AddDefaultText(retraites, y += CheckBoxPosition, 200, height, x += tabCheck);


            ReportBL.PlotBooleanValue(pdfGen, sansactivitesV, y -= CheckBoxPosition, x += tabCheck + 50);
            pdfGen.AddDefaultText(sansactivites, y += CheckBoxPosition, 200, height, x += tabCheck);

            ReportBL.PlotBooleanValue(pdfGen, autresactivitesV, y -= CheckBoxPosition, x += tabCheck + 50);
            pdfGen.AddDefaultText(autresactivites, y += CheckBoxPosition, 200, height, x += tabCheck);

            #region "Métier et secteur d'activité"
            string metierOuAncienneProfessionLbl = languageData.GetContent("ClientPP_Titulaire_072");
            if (enactivitesV != null)
            {
                metierOuAncienneProfessionLbl = languageData.GetContent("ClientPP_Titulaire_072").Replace(":", string.Empty);
            }
            else if (retraitesV != null)
            {
                metierOuAncienneProfessionLbl = languageData.GetContent("ClientPP_Titulaire_079").Replace(":", string.Empty);
            }
            else if (sansactivitesV != null)
            {
                metierOuAncienneProfessionLbl = languageData.GetContent("ClientPP_Titulaire_082").Replace(":", string.Empty);
            }
            else if (autresactivitesV != null)
            {
                metierOuAncienneProfessionLbl = languageData.GetContent("ClientPP_Titulaire_075").Replace(":", string.Empty);
            }

            /*if (retraitesV != null || sansactivitesV != null)
            {
                metierOuAncienneProfessionLbl = languageData.GetContent("ClientPP_Titulaire_079");
                x = 0;
                y += interline;
                string depuisle = languageData.GetContent("ClientPP_Titulaire_depuisle");
                //float lnpx8 = pdfGen.GetWidthOfString(depuisle);
                float lnpx8 = LNPX;
                float wdth8 = lnpx8 * 31 / 50;
                float wdth8nswer = 490 - (10 + wdth8);

                float additive8 = lnpx8 >= 150 ? (lnpx8 / 100) : 10;

                pdfGen.AddDefaultText(depuisle, y, label_width, height, x);
                int value = retraitesV != null ? 166 : 169;
                pdfGen.AddAnswer(GetReportOptionAttributeValueByIdOptionAttribute(value, report), y, wdth8nswer, 20, x += 135);
            }*/

            string metierOuAncienneProfessionLblV = string.Empty;
            if (enactivitesV != null)
                metierOuAncienneProfessionLblV = GetReportOptionAttributeValueByIdOptionAttribute(160, report);
            else if (retraitesV != null)
                metierOuAncienneProfessionLblV = GetReportOptionAttributeValueByIdOptionAttribute(167, report);
            else if (sansactivitesV != null)
                metierOuAncienneProfessionLblV = GetReportOptionAttributeValueByIdOptionAttribute(170, report);
            else if (autresactivitesV != null)
                metierOuAncienneProfessionLblV = GetReportOptionAttributeValueByIdOptionAttribute(163, report);

            string dateAct = languageData.GetContent("ClientPP_Titulaire_en_activite_depuis_le").Replace(":", string.Empty);
            string dateValue = string.Empty;
            
            string sectAct = string.Format(languageDataPP.GetContent("PdfReportPP_300"), string.Empty);
            string sectActV = string.Empty;
            if (enactivitesV != null)
            {
                sectActV = GetReportOptionAttributeValueByIdOptionAttribute(161, report);
                dateAct = languageData.GetContent("ClientPP_Titulaire_en_activite_depuis_le").Replace(":", string.Empty);
                dateValue = GetReportOptionAttributeValueByIdOptionAttribute(903, report);
            }
            else if (retraitesV != null)
            {
                sectActV = GetReportOptionAttributeValueByIdOptionAttribute(168, report);
                dateAct = languageData.GetContent("ClientPP_Titulaire_078").Replace(":", string.Empty);
                dateValue = GetReportOptionAttributeValueByIdOptionAttribute(166, report);
            }
            else if (sansactivitesV != null)
            {
                sectActV = GetReportOptionAttributeValueByIdOptionAttribute(171, report);
                dateAct = languageData.GetContent("ClientPP_Titulaire_081").Replace(":", string.Empty);
                dateValue = GetReportOptionAttributeValueByIdOptionAttribute(169, report);
            }
            else if (autresactivitesV != null)
            {
                sectActV = GetReportOptionAttributeValueByIdOptionAttribute(164, report);
                dateAct = languageData.GetContent("ClientPP_Titulaire_autre_activite_depuis_le").Replace(":", string.Empty);
                dateValue = GetReportOptionAttributeValueByIdOptionAttribute(904, report);
            }

            y += interline;
            GenerateDoubleColonne(pdfGen, metierOuAncienneProfessionLbl, metierOuAncienneProfessionLblV, sectAct, sectActV, ref y);
            #endregion

            y += interline;
            var yTp3 = y;
            pdfGen.CalculeZoneWithAutomaticNewPage(ref y, height);
            if (y > 0) y = yTp3;
            x = 0;
            pdfGen.AddDefaultText(dateAct, y, label_width, height, x);
            pdfGen.AddAnswer(dateValue, y, wdthAnswer, 20, x += 92);

            // mandataires
            x = 0;
            y += interline;
            pdfGen.AddDefaultText(languageData.GetContent("ClientPP_Titulaire_mandataire_1146"), y, label_width, height, x);
            x = 50;
            ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(1299, report), y, x);
            pdfGen.AddDefaultText(languageData.GetContent("ClientPP_Titulaire_030"), y += CheckBoxPosition, 200, height, x += tabCheck);
            ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(1300, report), y -= CheckBoxPosition, x += tabYesNo * 1.5f);
            pdfGen.AddDefaultText(languageData.GetContent("ClientPP_Titulaire_031"), y += CheckBoxPosition, 200, height, x += tabCheck);

            var precisionsMandataire = GetReportOptionValueByIdOption(1301, report);
            if (precisionsMandataire!=null || pIsEmptyReport)
            {
                y += interline;
                string notes = languageData.GetContent("ClientPP_Titulaire_notes_1146");
                pdfGen.AddTextAreaNote(notes, y);

                y += 10;
                x = 0;
                float lstY = y;
                pdfGen.AddBlueBorderWithAutomaticNewPage(ref y, x, 500, 50);
                lstY += 7;
                x += 5;
                pdfGen.AddJustifyTextWithAutomaticNewPage(GetReportOptionAttributeValueByIdOptionAttribute(795, report), ref lstY, 480, 46,
                    x);
            }

            #endregion

            #region         III.	Situation familiale

            y = y + (interline*1.25f);
            var yTmp2 = y;
            pdfGen.CalculeZoneWithAutomaticNewPage(ref y, (2*height));
            if (y > 0)
                y = yTmp2;
            x = 20;
            var reportMarried = GetReportOptionValueByIdOption(278, report); // married
            var reportCelibatire = GetReportOptionValueByIdOption(280, report);
            var reportDivorce = GetReportOptionValueByIdOption(282, report);
            var reportSepare = GetReportOptionValueByIdOption(283, report);
            var reportPACS = GetReportOptionValueByIdOption(279, report);
            var reportVeuf = GetReportOptionValueByIdOption(281, report);
            var reportConcubine = GetReportOptionValueByIdOption(284, report);


            pdfGen.AddSubtitle(string.Format("III. {0}", languageDataPP.GetContent("PdfReportPP_333").Replace("VI.", string.Empty)), y, max_width, height, x);

            x = 0;

            var tabLib = new string[] { "PdfReportPP_334", "PdfReportPP_336", "PdfReportPP_338", "PdfReportPP_340", "PdfReportPP_335", "PdfReportPP_337", "PdfReportPP_339" };

            int cpt = -1;
            if (reportMarried != null) cpt = 0;
            else if (reportCelibatire != null) cpt = 1;
            else if (reportDivorce != null) cpt = 2;
            else if (reportSepare != null) cpt = 3;
            else if (reportPACS != null) cpt = 4;
            else if (reportVeuf != null) cpt = 5;
            else if (reportConcubine != null) cpt = 6;

            y += interline ;

            ReportBL.PlotBooleanValue(pdfGen, reportMarried, y, x);
            pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_334"), y += CheckBoxPosition, max_width, height, x += tabCheck);

            //if (!string.IsNullOrEmpty(hostCode) && hostCode == "BE")
            //{
            //    ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(1252, report), y -= CheckBoxPosition, (padding_left * 4) + 15);
            //    pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_340_2"), y += CheckBoxPosition, max_width, height, (padding_left * 4) + 15 + tabCheck);
            //}

            ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(280, report), y -= CheckBoxPosition, x += 40);
            pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_336"), y += CheckBoxPosition, max_width, height, x += tabCheck);

            ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(282, report), y -= CheckBoxPosition, x += 43);
            pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_338"), y += CheckBoxPosition, max_width, height, x += tabCheck);

            ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(283, report), y -= CheckBoxPosition, x += 40);
            pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_340"), y += CheckBoxPosition, max_width, height, x += tabCheck);
            //if (!string.IsNullOrEmpty(hostCode) && hostCode == "BE")
            //{
            //    ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(1253, report), y -= CheckBoxPosition, padding_left * 2);
            //    pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_340_1"), y += CheckBoxPosition, max_width, height, (padding_left * 2) + tabCheck);
            //}

            if (!string.IsNullOrEmpty(hostCode) && hostCode == "BE")
                x += 75;
            else x += 40;
            ReportBL.PlotBooleanValue(pdfGen, reportPACS, y -= CheckBoxPosition, x);
            pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_335"), y += CheckBoxPosition, max_width, height, x += tabCheck);

            if (!string.IsNullOrEmpty(hostCode) && hostCode == "BE")
                x += 82;
            else x += 40;
            ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(281, report), y -= CheckBoxPosition, x);
            pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_337"), y += CheckBoxPosition, max_width, height, x += tabCheck);

            ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(284, report), y -= CheckBoxPosition, x += 40);
            pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_339"), y += CheckBoxPosition, max_width, height, x += tabCheck);

            // TODO à activer si OK en front
            //if (!string.IsNullOrEmpty(hostCode) && hostCode == "BE")
            //{
            //    y += interline;
            //    x = 0;
            //    ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(1252, report), y -= CheckBoxPosition, x);
            //    pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_340_2"), y += CheckBoxPosition, max_width, height, x += tabCheck);

            //    ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(1253, report), y -= CheckBoxPosition, x+= 75);
            //    pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_340_1"), y += CheckBoxPosition, max_width, height, x += tabCheck);
            //}

            if (reportMarried != null || reportPACS != null || pIsEmptyReport)
            {
                y += interline;
                x = tabCheck;
                string dateEv = string.Format(languageDataPP.GetContent("PdfReportPP_341"), string.Empty);
                string dateEvV = GetReportOptionAttributeValueByIdOptionAttribute(178, report);

                float lnpxA2 = pdfGen.GetWidthOfString(string.Format(languageDataPP.GetContent("PdfReportPP_341"), string.Empty));
                float wdthA2 = lnpxA2 * 31 / 50;
                float wdthA2nswer = 500 - (10 + wdthA2);
                float additiveA2 = lnpxA2 >= 150 ? (lnpxA2 / 10) : 10;

                pdfGen.AddDefaultText(dateEv, y, label_width, height, x);
                pdfGen.AddAnswer(dateEvV, y, wdthA2nswer, 20, x += wdthA2 + additiveA2);
            }

            #endregion

            #region IV.	Régime matrimonial


            x = 20;
            var yTmp3 = y + (interline * 2f);
            y += interline * 2f; // subtitle
            if (reportMarried!=null)
            {
                y += 4 * (interline);
            }
            pdfGen.CalculeZoneWithAutomaticNewPage(ref y, 5*height);

            if (y > 0)
                y = yTmp3;

            pdfGen.AddSubtitle(string.Format("IV. {0}", languageDataPP.GetContent("PdfReportPP_342").Replace("VII.", string.Empty)), y, max_width, height, x);
            #region "Is married Or Empty Report"
            if (reportMarried != null || pIsEmptyReport)
            {
                Func<string, ReportOptionValue, string, ReportOptionValue, float, bool, string> TwiceColonneCheckbox = (colonneA, colonneAValue, colonneB, colonneBValue, y1, isIndent) =>
                {
                    x = isIndent ? 50 : 0;
                    ReportBL.PlotBooleanValue(pdfGen, colonneAValue, y1 -= CheckBoxPosition, x);
                    pdfGen.AddDefaultText(colonneA, y1 += CheckBoxPosition, label_width, height, x += tabCheck);

                    if (!string.IsNullOrEmpty(colonneB))
                    {
                        x = isIndent ? 300 : 250;
                        ReportBL.PlotBooleanValue(pdfGen, colonneBValue, y1 -= CheckBoxPosition, x);
                        pdfGen.AddDefaultText(colonneB, y1 += CheckBoxPosition, label_width, height, x += tabCheck);
                    }
                    return string.Empty;
                };

                #region "Row 1"
                // Sépartation des biens
                string sepBien = languageDataPP.GetContent("PdfReportPP_344");
                var sepBienV = GetReportOptionValueByIdOption(287, report);

                // Communauté universelle
                string comUniv = languageDataPP.GetContent("PdfReportPP_346");
                var comUnivV = GetReportOptionValueByIdOption(289, report);

                y += interline;
                TwiceColonneCheckbox(sepBien, sepBienV, comUniv, comUnivV, y, false);
                #endregion

                #region "Row 2"
                // dilemne
                string dilemne = string.Empty;
                ReportOptionValue dilemneV = null;
                if (!string.IsNullOrEmpty(hostCode) && hostCode == "BE")
                {
                    // Régime légal
                    dilemne = languageDataPP.GetContent("PdfReportPP_Regime_Leg");
                    dilemneV = GetReportOptionValueByIdOption(1250, report);
                }
                else
                {
                    // Participation aux acquêts
                    dilemne = languageDataPP.GetContent("PdfReportPP_345");
                    dilemneV = GetReportOptionValueByIdOption(288, report);
                }

                // Séparation de biens avec société d’acquêts
                var sepBienAcq = languageDataPP.GetContent("PdfReportPP_346_1");
                var sepBienAcqV = GetReportOptionValueByIdOption(1159, report);

                y += interline;
                TwiceColonneCheckbox(dilemne, dilemneV, sepBienAcq, sepBienAcqV, y, false);
                #endregion

                #region "Row 3"
                // Communauté réduite aux acquêts (régime légal après 1966)
                string comRed = languageDataPP.GetContent("PdfReportPP_Com_Reduite");
                var comRedV = GetReportOptionValueByIdOption(1148, report);

                // Communauté meubles et acquêts (régime légal avant 1966)
                string comMeuAcq = languageDataPP.GetContent("PdfReportPP_343");
                var comMeuAcqV = GetReportOptionValueByIdOption(1158, report);

                y += interline;
                TwiceColonneCheckbox(comRed, comRedV, comMeuAcq, comMeuAcqV, y, false);
                #endregion

                #region "Row 4"
                // autres
                var othersV = GetReportOptionValueByIdOption(1160, report);
                string others = languageData.GetContent("ClientPP_Titulaire_1258");


                y += interline;
                TwiceColonneCheckbox(others, othersV, string.Empty, null, y, false);
                #endregion

                var yTmp4 = y + interline + 5;
                y += 3 * (interline);
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, 3 * height);
                if (y > 0)
                    y = yTmp4;

                #region "Row 5"
                x = 20;
                //Avez-vous mis en place des procédures de protection pour votre conjoint
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_347_1"), y, max_width, height);

                // Oui
                x = 375;
                var procOui = GetReportOptionValueByIdOption(1162, report);
                ReportBL.PlotBooleanValue(pdfGen, procOui, y -= CheckBoxPosition, x);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_Yes"), y += CheckBoxPosition, max_width, height, x += tabCheck);

                // Non
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(1163, report), y -= CheckBoxPosition, x += tabYesNo);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_No"), y += CheckBoxPosition, max_width, height, x += tabCheck);
                #endregion

                if (procOui != null || pIsEmptyReport)
                {
                    #region "Row 6"
                    x = 20;
                    y += interline;
                    // Les clauses d’avantages matrimoniaux
                    ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(1164, report), y, x);
                    pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_347_2"), y += CheckBoxPosition, max_width, height, x += tabCheck);
                    #endregion

                    #region "Row 7"
                    // Clause de préciput
                    string clausePreciput = languageDataPP.GetContent("PdfReportPP_347_2_1");
                    var clausePreciputV = GetReportOptionValueByIdOption(1168, report);

                    // Clause de partage inégal de la communauté
                    string clausePartageInegal = languageDataPP.GetContent("PdfReportPP_347_2_2");
                    var clausePartageInegalV = GetReportOptionValueByIdOption(1169, report);

                    y += interline;
                    TwiceColonneCheckbox(clausePreciput, clausePreciputV, clausePartageInegal, clausePartageInegalV, y, true);
                    #endregion

                    #region "Row 8"
                    // Clause d’attribution intégrale de la communauté 
                    string clauseAttributionIntegrale = languageDataPP.GetContent("PdfReportPP_347_2_3");
                    var clauseAttributionIntegraleV = GetReportOptionValueByIdOption(1170, report);

                    // Clause de main commune 
                    string clauseMainCommune = languageDataPP.GetContent("PdfReportPP_347_2_5");
                    var clauseMainCommuneV = GetReportOptionValueByIdOption(1172, report);

                    y += interline;
                    TwiceColonneCheckbox(clauseAttributionIntegrale, clauseAttributionIntegraleV, clauseMainCommune, clauseMainCommuneV, y, true);
                    #endregion

                    #region "Row 9"
                    // Clause de prélèvement moyennant indemnité (clause commerciale)    
                    string clauseCom = languageDataPP.GetContent("PdfReportPP_347_2_4");
                    var clauseComV = GetReportOptionValueByIdOption(1171, report);

                    y += interline;
                    TwiceColonneCheckbox(clauseCom, clauseComV, null, null, y, true);
                    #endregion

                    #region "Row 10"
                    x = 20;
                    y += interline;
                    yTmp4 = y;
                    pdfGen.CalculeZoneWithAutomaticNewPage(ref y, height);
                    if (y > 0)
                        y = yTmp4;
                    // Les clauses d’attribution intégrale de la communauté 
                    ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(1165, report), y, x);
                    pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_347_3"), y += CheckBoxPosition, max_width, height, x += tabCheck);
                    #endregion

                    #region "Row 11"
                    x = 20;
                    y = y + interline;
                   // y += 2 * (interline + 5);
                    yTmp4 = y;
                    pdfGen.CalculeZoneWithAutomaticNewPage(ref y, 2 * height);
                    if (y > 0)
                        y = yTmp4;
                    // Donations entre époux (élargir les quotités) :
                    ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(1166, report), y, x);
                    pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_347_4"), y += CheckBoxPosition, max_width, height, x += tabCheck);
                    #endregion

                    #region "Row 12"
                    //  Donation du vivant
                    string donVivant = languageDataPP.GetContent("PdfReportPP_347_4_1");
                    var donVivantV = GetReportOptionValueByIdOption(1173, report);

                    // Donation au dernier des vivants
                    string donDernVivant = languageDataPP.GetContent("PdfReportPP_347_4_2");
                    var donDernVivantV = GetReportOptionValueByIdOption(1174, report);

                    y += interline;
                    TwiceColonneCheckbox(donVivant, donVivantV, donDernVivant, donDernVivantV, y, true);
                    #endregion

                    #region "Row 13"
                    x = 20;
                    y += interline;
                    yTmp4 = y;
                    pdfGen.CalculeZoneWithAutomaticNewPage(ref y, height);
                    if (y > 0)
                        y = yTmp4;
                    // Testament
                    ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(1167, report), y, x);
                    pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_347_5"), y += CheckBoxPosition, max_width, height, x += tabCheck);
                    #endregion
                }
            } 
            #endregion

            #endregion

            #region V.	Liberalites

            y += (interline*2f);
            yTmp2 = y;
            pdfGen.CalculeZoneWithAutomaticNewPage(ref y, 3*16);
            if (y > 0)
                y = yTmp2;
            
            //Title
            x = 20;
            pdfGen.AddSubtitle(string.Format("V. {0}", languageDataPP.GetContent("PdfReportPP_Liberalite").Replace("VIII.", string.Empty)), y, max_width, height, x);

            y += paddingAfterParagraph;
            GenerateLiberaliteTable(pdfGen, report, ref y,pIsEmptyReport);

            #endregion

            #region VI.	Composition du foyer

            y += interline;
            yTmp2 = y;
            pdfGen.CalculeZoneWithAutomaticNewPage(ref y, 3 * 16);
            if (y > 0)
                y = yTmp2;

            x = 20;
            pdfGen.AddSubtitle(string.Format("VI. {0}", languageDataPP.GetContent("PdfReportPP_358").Replace("X.", string.Empty)), y, max_width, height, x);
            List<ReportOptionAttributeValue> enfants = report.ReportOptionAttributeValue.Where(roav => roav.idOptionAttribute == 192)
           .OrderBy(roav => roav.idReportOptionAttributeValue)
           .ToList();


            #region "a) Enfants"
            x += 20;
            y += interline;
            pdfGen.AddTextBoldSubtitle(string.Format("a) {0}", languageDataPP.GetContent("PdfReportPP_359")), y, max_width, height, x);
           // if ((enfants != null && enfants.Any()) || pIsEmptyReport) --> always show header
            {
                y += interline;
                GeneratePersonneAChargeEnfantTable(pdfGen, report, ref y,pIsEmptyReport);
            } 
            #endregion

            #region "b) Autres personnes à charge"
            List<ReportOptionAttributeValue> autres =
           report.ReportOptionAttributeValue.Where(roav => roav.idOptionAttribute == 193)
               .OrderBy(roav => roav.idReportOptionAttributeValue)
               .ToList();
            y += interline + 5;
            pdfGen.AddTextBoldSubtitle(string.Format("b) {0}", languageDataPP.GetContent("PdfReportPP_360")), y, max_width, height, x);
            //   if ((autres != null && autres.Any()) || pIsEmptyReport) --> always show header
            {
                y += interline;
                GenerateAutresPersonnesAChargeTable(pdfGen, report, ref y, pIsEmptyReport);
            } 
            #endregion

            #endregion
        }
Esempio n. 2
0
        private static void GeneratePPOrientationPatrimoniales(FoxitPDFGenerator pdfGen, Data.Model.Report report,ref float y,bool pIsEmptyReport)
        {
            var languageDataPP = PageLanguageHelper.GetLanguageContent("User", "PDFReportPP");
            if(y > 0) y += interline + 10;

            #region Hierarchisation des priorités

            var yTmp1 = y;
            var hGth1 = 3f*paddingAfterParagraph + height + 2*20;
            pdfGen.CalculeZoneWithAutomaticNewPage(ref y,hGth1);

            pdfGen.AddTitle(languageDataPP.GetContent("PdfReportPP_149"), y, max_width, height);//V0S ORIENTATIONS PATRIMONIALES
            pdfGen.AddDefaultBoldText(languageDataPP.GetContent("PdfReportPP_150"), y += (1f * paddingAfterParagraph), max_width, 20);//Hiérarchisation des priorités
            pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_151"), y += interline, max_width, 20);
            y += interline;
            var listIdOptionAttributes = BuildOrientationTableFixIssue9985(pdfGen, report, ref y, pIsEmptyReport);

            //Note
            y += 10;
            pdfGen.AddLabelNoteWithAutomaticNewPage(languageDataPP.GetContent("PdfReportPP_Notes"), ref y, 500, 20);
            y += interline;

            pdfGen.AddDynamicBlueBorderWithText(GetReportOptionAttributeValueByIdOptionAttribute(229, report),ref y, 0, max_width,50);
            #endregion
            float x = 0;
            float oHeight = 0;
            float yTmp = 0;

            var indexation = new List<string> { "a)", "b)", "c)", "d)", "e)", "f)", "g)" };
            var usedIndexation = new List<string>();

            Func<string> NextIndexation = () =>
            {
                string nxt = string.Empty;
                foreach (string idx in indexation)
                {
                    if (!usedIndexation.Any(q => q == idx))
                    {
                        usedIndexation.Add(idx);
                        nxt = idx;
                        break;
                    }
                }
                return nxt;
            };

            Func<string, int, int, string, int, int, float, bool, string> GenerateDoubleColonneOrientationPatrimoine = (colonneALbl, idAYes, idANo, colonneBLbl, idBYes, idBNo, y1, isWithSecondCol) =>
            {
                x = 0;
                const float maxColWidth = 240;
                float lnpxAA = 150, lnpxBB = 162;
                float wdthAA = lnpxAA * 31 / 50;
                float wdthAAnswer = maxColWidth - (10 + wdthAA);
                float wdthBB = lnpxBB * 31 / 50;

                pdfGen.AddDefaultText(colonneALbl, y1, 180, height, x);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_Yes"), y1, max_width, height, x += 180);
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(idAYes, report), y1, x = x + 15);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_No"), y1, max_width, height, x = x + tabYesNo);
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(idANo, report), y1, x = x + 15);

                if (isWithSecondCol)
                {
                    x = 250;
                    pdfGen.AddDefaultText(colonneBLbl, y1, label_width, height, x);
                    pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_Yes"), y1, max_width, height, x += 180);
                    ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(idBYes, report), y1, x = x + 15);
                    pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_No"), y1, max_width, height, x = x + tabYesNo);
                    ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(idBNo, report), y1, x = x + 15); 
                }
                return string.Empty;
            };
	

                
            #region a) Aquerir un bien immobilier
            if (listIdOptionAttributes.Any(ioa => ioa == 237) || pIsEmptyReport)
            {

                yTmp = y + interline;

                pdfGen.CalculeZoneWithAutomaticNewPage(ref y,3*height);
                if (y > 0) y = yTmp;

                pdfGen.AddOrangeTitleWithAutomaticNewPage(string.Format("{0} {1}",NextIndexation(),LanguageContentBL.Translate("PdfReportPP_152").Replace("a)",string.Empty)), ref y, 500, 20, 15);//a) Acquérir un bien immobilier
                y += interline+5;
                var montantAInvestir = GetReportOptionAttributeValueByIdOptionAttribute(547, report);
                pdfGen.AddDefaultTextWithAutomaticNewPage(String.Format(LanguageContentBL.Translate("PdfReportPP_153").Replace("€",string.Empty), string.Empty), ref y, max_width, height);
                pdfGen.AddAnswer(pIsEmptyReport?string.Empty: montantAInvestir, y, 100, 20, 250);
                pdfGen.AddDefaultTextWithAutomaticNewPage("€", ref y, 100, height,345);
                y += interline;
                pdfGen.AddDefaultTextWithAutomaticNewPage(String.Format(LanguageContentBL.Translate("PdfReportPP_154")), ref y, max_width, height);

                y = y + interline;
                yTmp = y;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, 6 * height);

                if (y > 0)
                {
                    y = yTmp;
                }

                #region "zone 1 "

                yTmp = y;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, height);
                if (y > 0) y = yTmp;
                #region "Row 1"

                string lblColA = languageDataPP.GetContent("PdfReportPP_155");
                string lblColB = languageDataPP.GetContent("PdfReportPP_156");
                GenerateDoubleColonneOrientationPatrimoine(lblColA,813,814, lblColB,816,817,y,true);
                #endregion

                #region "Row 2"
                y += interline;
                yTmp = y;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, height);
                if (y > 0) y = yTmp;
                lblColA = languageDataPP.GetContent("PdfReportPP_157");
                lblColB = languageDataPP.GetContent("PdfReportPP_158");
                GenerateDoubleColonneOrientationPatrimoine(lblColA, 819, 820, lblColB, 822, 823, y,true);
	            #endregion

                #region "Row 3"
                y += interline;
                yTmp = y;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, height);
                if (y > 0) y = yTmp;
                lblColA = languageDataPP.GetContent("PdfReportPP_159");
                lblColB = languageDataPP.GetContent("PdfReportPP_160");
                GenerateDoubleColonneOrientationPatrimoine(lblColA, 825, 826, lblColB, 828, 829, y,true);
                #endregion
                #endregion

                y += interline;
                yTmp = y;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, 6 * height);

                #region "Zone 2"

                if (y > 0)
                {
                    y = yTmp;
                  //  y += interline + 15;
                }
                pdfGen.AddDefaultTextWithAutomaticNewPage(string.Format(languageDataPP.GetContent("PdfReportPP_161"), GetReportOptionAttributeValueByIdOptionAttribute(548, report)), ref y, max_width, height);

                pdfGen.AddDefaultText(String.Format(languageDataPP.GetContent("PdfReportPP_162")), y += interline, max_width, height);//L’immobilier pour vous est synonyme de :

                #region "Row 1"
                y += interline;
                yTmp = y;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, height);
                if (y > 0) y = yTmp;
                lblColA = languageDataPP.GetContent("PdfReportPP_163");
                lblColB = languageDataPP.GetContent("PdfReportPP_164");
                GenerateDoubleColonneOrientationPatrimoine(lblColA, 832, 833, lblColB, 835, 836, y,true);
                #endregion

                #region "Row 2"
                y += interline;
                yTmp = y;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, height);
                if (y > 0) y = yTmp;
                lblColA = languageDataPP.GetContent("PdfReportPP_165");
                lblColB = languageDataPP.GetContent("PdfReportPP_166");
                GenerateDoubleColonneOrientationPatrimoine(lblColA, 838, 839, lblColB, 841, 842, y,true);
                #endregion

                #region "Row 3"
                y += interline;
                yTmp = y;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, height);
                if (y > 0) y = yTmp;
                lblColA = languageDataPP.GetContent("PdfReportPP_167");
                lblColB = languageDataPP.GetContent("PdfReportPP_168");
                GenerateDoubleColonneOrientationPatrimoine(lblColA, 844, 845, lblColB, 847, 848, y,true);
                #endregion

                #region "Row 4"
                y += interline;
                yTmp = y;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, height);
                if (y > 0) y = yTmp;
                lblColA = languageDataPP.GetContent("PdfReportPP_169");
                lblColB = string.Empty;
                GenerateDoubleColonneOrientationPatrimoine(lblColA, 850, 851, lblColB, 0, 0, y, false); 
                #endregion
                #endregion

                string noteValue = GetReportOptionAttributeValueByIdOptionAttribute(549, report);
                pdfGen.DynamicBlueBorderZoneSize(noteValue, y, out oHeight);
                y = y + interline;
                yTmp = y;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, oHeight);

                if(y > 0) y = yTmp;

                pdfGen.AddLabelNote(languageDataPP.GetContent("PdfReportPP_Notes"), y += interline, 500, 20);
                y += interline;
                pdfGen.AddDynamicBlueBorderWithText(noteValue,ref y, 0, max_width ,50); //TODO_TONNY
            }
            #endregion

            #region b) Constituer une épargne, accroître la rentabilité
            if (listIdOptionAttributes.Any(ioa => ioa == 235 || ioa == 236) || pIsEmptyReport)
            {
                y = y + interline;
                yTmp = y;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, 2 * height);
                if (y > 0) y = yTmp;

                pdfGen.AddOrangeTitleWithAutomaticNewPage(string.Format("{0} {1}", NextIndexation(), languageDataPP.GetContent("PdfReportPP_170").Replace("b)", string.Empty)), ref y, 500, 20, 15);//b) Constituer une épargne, accroître la rentabilité
                x = 0;

                y += interline + 5;
                pdfGen.AddDefaultTextWithAutomaticNewPage(languageDataPP.GetContent("PdfReportPP_171"), ref y, max_width, height);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_Yes"), y, max_width, height, x += 100);
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(855, report), y, x = x + tabCheck + 5);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_No"), y, max_width, height, x = x + tabYesNo);
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(856, report), y, x = x + tabCheck + 5);

                pdfGen.AddDefaultText(string.Format(languageDataPP.GetContent("PdfReportPP_172"), GetReportOptionAttributeValueByIdOptionAttribute(550, report)), y += interline, max_width, height);

                yTmp = y;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, 6 * height);
                if (y > 0)
                {
                    y = yTmp;
                }

                x = 0;
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_173"), y += interline, max_width, height);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_Yes"), y, max_width, height, x += 325);
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(858, report), y, x = x + tabCheck + 5);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_No"), y, max_width, height, x = x + tabYesNo);
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(859, report), y, x = x + tabCheck + 5);
                string value722 = GetReportOptionAttributeValueByIdOptionAttribute(722, report);
                value722 = string.Format("{0}", !string.IsNullOrEmpty(value722) ? value722 : string.Empty);
                pdfGen.AddAnswer(value722, y, 50, height, x += tabCheck + 5);
                pdfGen.AddDefaultText("€", y, 75, height, x += 50);

                x = 0;
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_174"), y += interline, max_width, height);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_Yes"), y, max_width, height, x += 325);
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(861, report), y, x = x + tabCheck + 5);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_No"), y, max_width, height, x = x + tabYesNo);
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(862, report), y, x = x + tabCheck + 5);
                string value723 = GetReportOptionAttributeValueByIdOptionAttribute(723, report);
                value723 = string.Format("{0}", !string.IsNullOrEmpty(value723) ? value723 : string.Empty);
                pdfGen.AddAnswer(value723, y, 50, height, x += tabCheck + 5);
                pdfGen.AddDefaultText("€", y, 75, height, x += 50);

                x = 0;
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_175"), y += interline, max_width, height);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_Yes"), y, max_width, height, x += 325);
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(864, report), y, x = x + tabCheck + 5);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_No"), y, max_width, height, x = x + tabYesNo);
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(865, report), y, x = x + tabCheck + 5);
                string value724 = GetReportOptionAttributeValueByIdOptionAttribute(724, report);
                value724 = string.Format("{0}", !string.IsNullOrEmpty(value724) ? value724 : string.Empty);
                pdfGen.AddAnswer(value724, y, 50, height, x += tabCheck + 5);
                pdfGen.AddDefaultText("€", y, 75, height, x += 50);

                y += interline;
                yTmp = y;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, height);
                if (y > 0) y = yTmp;
                var lblColA = languageDataPP.GetContent("PdfReportPP_176");
                var lblColB = languageDataPP.GetContent("PdfReportPP_177");
                GenerateDoubleColonneOrientationPatrimoine(lblColA, 867, 868, lblColB, 0, 0, y, false);

                y += interline;
                yTmp = y;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, height);
                if (y > 0) y = yTmp;
                lblColA = languageDataPP.GetContent("PdfReportPP_177");
                lblColB = string.Empty;
                GenerateDoubleColonneOrientationPatrimoine(lblColA, 870, 871, lblColB, 0, 0, y, false);

                y += interline;
                yTmp = y;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, height);
                if (y > 0) y = yTmp;
                lblColA = languageDataPP.GetContent("PdfReportPP_178");
                lblColB = string.Empty;
                GenerateDoubleColonneOrientationPatrimoine(lblColA, 873, 874, lblColB, 0, 0, y, false);

                string noteValue = GetReportOptionAttributeValueByIdOptionAttribute(551, report);
                pdfGen.DynamicBlueBorderZoneSize(noteValue, y, out oHeight);
                yTmp = y + interline;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, oHeight);

                if(y > 0) y = yTmp;

                pdfGen.AddLabelNote(languageDataPP.GetContent("PdfReportPP_Notes"), y, 500, 20);
                y += interline;
                pdfGen.AddDynamicBlueBorderWithText(noteValue ,ref y, 0, max_width,50);
            }
            #endregion

            #region c) Protection de la Famille

            Func<string, int, int, string, int, float, string> GenerateDoubleColonneOrientationPatrimoineWithAnswer = (colonneALbl, idAYes, idANo, colonneBLbl, idAnswer, y1) =>
            {
                x = 0;
                const float maxColWidth = 240;
                float lnpxAA = 150, lnpxBB = 162;
                float wdthAA = lnpxAA * 31 / 50;
                float wdthAAnswer = maxColWidth - (10 + wdthAA);
                float wdthBB = lnpxBB * 31 / 50;

                pdfGen.AddDefaultText(colonneALbl, y1, label_width, height, x);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_Yes"), y1, max_width, height, x += 180);
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(idAYes, report), y1, x = x + 15);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_No"), y1, max_width, height, x = x + tabYesNo);
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(idANo, report), y1, x = x + 15);

                x = 250;
                pdfGen.AddDefaultText(string.Format(colonneBLbl,string.Empty), y1, label_width, height, x);
                pdfGen.AddAnswer(GetReportOptionAttributeValueByIdOptionAttribute(idAnswer, report), y1, 75, height, x += 160);
                return string.Empty;
            };

            if (listIdOptionAttributes.Any(ioa => ioa == 230) || pIsEmptyReport)
            {
                yTmp = y + interline;

                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, 2 * height);
                if (y > 0) y = yTmp;

                pdfGen.AddOrangeTitle(string.Format("{0} {1}", NextIndexation(), languageDataPP.GetContent("PdfReportPP_179").Replace("c)", string.Empty)), y, 500, 20, 15);//c) Protection de la Famille  
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_180"), y += interline + 5, max_width, height);


                y += interline;
                yTmp = y;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, height);
                if (y > 0) y = yTmp;
                var lblColA = languageDataPP.GetContent("PdfReportPP_181");
                var lblColB = languageDataPP.GetContent("PdfReportPP_184");
                GenerateDoubleColonneOrientationPatrimoineWithAnswer(lblColA, 879, 880, lblColB, 552, y);

                y += interline;
                yTmp = y;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, height);
                if (y > 0) y = yTmp;
                lblColA = languageDataPP.GetContent("PdfReportPP_182");
                lblColB = languageDataPP.GetContent("PdfReportPP_184");
                GenerateDoubleColonneOrientationPatrimoineWithAnswer(lblColA, 883, 884, lblColB, 553, y);

                y += interline;
                yTmp = y;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, height);
                if (y > 0) y = yTmp;
                lblColA = languageDataPP.GetContent("PdfReportPP_183");
                lblColB = languageDataPP.GetContent("PdfReportPP_184");
                GenerateDoubleColonneOrientationPatrimoineWithAnswer(lblColA, 887, 888, lblColB, 554, y);

                string noteValue = GetReportOptionAttributeValueByIdOptionAttribute(555, report);
                pdfGen.DynamicBlueBorderZoneSize(noteValue, y, out oHeight);
                yTmp = y + interline;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, oHeight);

                if(y > 0) y = yTmp;

                pdfGen.AddLabelNote(languageDataPP.GetContent("PdfReportPP_Notes"), y += paddingAfterParagraph, 500, 20);
                y += interline;
                pdfGen.AddDynamicBlueBorderWithText(noteValue, ref y, 0, max_width,50);
            }
            #endregion

            #region d) Préparer le budget étude des enfants
            if (listIdOptionAttributes.Any(ioa => ioa == 234) || pIsEmptyReport)
            {
                yTmp = y + interline;

                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, 4 * height);
                if (y > 0) y = yTmp;

                pdfGen.AddOrangeTitle(string.Format("{0} {1}", NextIndexation(), LanguageContentBL.Translate("PdfReportPP_185").Replace("d)", string.Empty)), y, 500, 20, 15);//d) Préparer le budget étude des enfants 
                pdfGen.AddDefaultText(String.Format(LanguageContentBL.Translate("PdfReportPP_186").Replace("€",string.Empty),string.Empty), y += interline);
                x = 250;
                var value556 = GetReportOptionAttributeValueByIdOptionAttribute(556, report);
                pdfGen.AddAnswer(value556, y, 75, 20, x);
                pdfGen.AddDefaultText("€", y, 75, 20, x += 75);
                x = 250;
                pdfGen.AddDefaultText(String.Format(LanguageContentBL.Translate("PdfReportPP_187"), string.Empty), y += interline);
                pdfGen.AddAnswer(GetReportOptionAttributeValueByIdOptionAttribute(557, report),y,75,20,x);
                pdfGen.AddDefaultText(String.Format(LanguageContentBL.Translate("PdfReportPP_188")), y += interline);

                yTmp = y;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, 4 * height);

                if (y > 0)
                {
                    y = yTmp;
                    y += interline + 5;
                }
                x = 0;
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(895, report), y , x);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_189"), y, max_width, height * 2, x += tabYesNo);
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(896, report), y, x += 110);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_190"), y, max_width, height * 2, x += tabYesNo);
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(897, report), y, x += 90);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_191"), y, max_width, height * 2, x += tabYesNo);

                x = 0;
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(898, report), y += interline, x);
                pdfGen.AddDefaultText(string.Format(languageDataPP.GetContent("PdfReportPP_192"), string.Empty), y, label_width, height, x += tabYesNo);

                 float lnpxA2 = pdfGen.GetWidthOfString(string.Format(languageDataPP.GetContent("PdfReportPP_192"), string.Empty));
                float wdthA2 = lnpxA2 * 31 / 50;
                float wdthA2nswer = 500 - (10 + wdthA2);
                float additiveA2 = lnpxA2 >= 150 ? (lnpxA2 / 10) : 10;

                pdfGen.AddAnswer(GetReportOptionAttributeValueByIdOptionAttribute(558, report), y, wdthA2nswer, 20, x += wdthA2 + additiveA2);

                 string noteValue = GetReportOptionAttributeValueByIdOptionAttribute(559, report);
                pdfGen.DynamicBlueBorderZoneSize(noteValue, y, out oHeight);
                yTmp = y + interline;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, oHeight+20);

                if(y > 0) y = yTmp;

                pdfGen.AddLabelNote(languageDataPP.GetContent("PdfReportPP_Notes"), y , 500, 20);
                y += interline;
                pdfGen.AddDynamicBlueBorderWithText(noteValue,ref y , 0, max_width,50);
            }
            #endregion
            
            #region e) Réduire vos impôts
            if (listIdOptionAttributes.Any(ioa => ioa == 233) || pIsEmptyReport)
            {
                y = y + interline + 5;
                yTmp = y;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, 2 * height);
                if (y > 0) y = yTmp;

                pdfGen.AddOrangeTitle(string.Format("{0} {1}", NextIndexation(), languageDataPP.GetContent("PdfReportPP_193").Replace("e)", string.Empty)), y, 500, 20, 15);//e) Réduire vos impôts  

                yTmp = y;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, (20 + 4 * height));
                if (y > 0)
                {
                    y = yTmp;
                }

                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_194"), y += interline, 500, 20, 15);

                x = 0;
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(902, report), y += interline, x);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_195"), y, max_width, height * 2, x += tabYesNo);

                x = 0;
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(903, report), y += interline, x);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_196"), y, max_width, height * 2, x += tabYesNo);

                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, (20 + 2 * height));
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_197"), y += interline + 5, 500, 20, 15);
                x = 0;
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(905, report), y += interline, x);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_198"), y, max_width, height * 2, x += tabYesNo);

                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(906, report), y, x += 80);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_199"), y, max_width, height * 2, x += tabYesNo);

                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(907, report), y, x += 80);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_190"), y, max_width, height * 2, x += tabYesNo);//l’Immobilier

                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(908, report), y, x += 80);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_200"), y, max_width, height * 2, x += tabYesNo);

                yTmp = y;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, (20 + 2 * height));
                if (y > 0) y = yTmp;
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_201"), y += interline + 5, 500, 20, 15);
                x = 0;
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(910, report), y += interline, x);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_202"), y, max_width, height, x += tabYesNo);

                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(911, report), y, x += 185);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_203"), y, max_width, height, x += tabYesNo);

                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(912, report), y, x += 80);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_204"), y, max_width, height, x += tabYesNo);

                pdfGen.AddDefaultText(LanguageContentBL.Translate("PdfReportPP_205"), y += interline, max_width, height);
                pdfGen.AddDefaultText(string.Format(LanguageContentBL.Translate("PdfReportPP_206"), report.IsEmptyReport ? "        " : GetReportOptionAttributeValueByIdOptionAttribute(560, report),
                     report.IsEmptyReport ? "        " : GetReportOptionAttributeValueByIdOptionAttribute(561, report)), y, max_width, height, 160);

                string noteValue = GetReportOptionAttributeValueByIdOptionAttribute(562, report);
                    pdfGen.DynamicBlueBorderZoneSize(noteValue, y, out oHeight);
                yTmp = y + interline;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, oHeight);

                if(y > 0) y = yTmp;

                pdfGen.AddLabelNote(languageDataPP.GetContent("PdfReportPP_Notes"), y, 500, 20);
                y += interline;
                pdfGen.AddDynamicBlueBorderWithText(noteValue,ref y,0,max_width,50);
            }
            #endregion

            #region f) Retraite

            if (listIdOptionAttributes.Any(ioa => ioa == 232) || pIsEmptyReport)
            {
                y = y + interline + 10;
                yTmp = y;

                string hostCode = Upsilab.Business.Utility.SessionManager.GetHostCodeSession();
                float hGth = 3 * height + 10;
                hGth += 2*height;
                hGth += 4 * height + 40 + 4 * interline;
                hGth += 2 * height + 40 + 20;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, hGth);

                pdfGen.AddOrangeTitle(string.Format("{0} {1}", NextIndexation(), languageDataPP.GetContent("PdfReportPP_207").Replace("f)", string.Empty)), y, 500, 20, 15);
                //f) Retraite :

                y += 15;

                #region "create table retraite"
                
                #endregion

                var yLast = y;
                //var currentPageNumber = pdfGen.GetCurrentPageNumber;

                

                yTmp = y;
                AddRetraitePPTable(pdfGen, ref y);

                y = yTmp;
                #region "First row"
                //float hGth = 3 * height + 10;
                //pdfGen.CalculeZoneWithAutomaticNewPage(ref y, hGth);
                //Disposez-vous d’un bilan de retraite ?
                string BilanVousOuiNon = "";
                string BilanVousDate = "";
                string BilanConjointOuiNon = "";
                string BilanConjointDate = "";

                var Vous =
                    report.ReportOptionAttributeValue.Where(roav => roav.idOptionAttribute == 564).FirstOrDefault();
                if (Vous != null)
                {
                    BilanVousOuiNon = Convert.ToString(Vous.CustomObjectValue.HasAssessmentPlan);
                    BilanVousDate = Convert.ToString(Vous.CustomObjectValue.AssessmentPlanDate);
                }

                var Conjoint =
                    report.ReportOptionAttributeValue.Where(roav => roav.idOptionAttribute == 565).FirstOrDefault();
                if (Conjoint != null)
                {
                    BilanConjointOuiNon = Convert.ToString(Conjoint.CustomObjectValue.HasAssessmentPlan);
                    BilanConjointDate = Convert.ToString(Conjoint.CustomObjectValue.AssessmentPlanDate);
                }


                x = 0;
                y = yLast;
                ReportBL.PlotBooleanValue(pdfGen, BilanVousOuiNon, y = y + interline, x += 190, "1");
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_Yes"), y, max_width, height, x += tabCheck);
                pdfGen.AddDefaultText(string.Format("Date : {0} ", BilanVousDate), y, max_width, height, x += 20);
                ReportBL.PlotBooleanValue(pdfGen, BilanConjointOuiNon, y, x += 125, "1");
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_Yes"), y, max_width, height, x += tabCheck);
                pdfGen.AddDefaultText(string.Format("Date : {0} ", BilanConjointDate), y, max_width, height, x += 20);

                x = 0;
                ReportBL.PlotBooleanValue(pdfGen, BilanVousOuiNon, y = y + interline, x += 190, "2");
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_No"), y, max_width, height, x += tabCheck);
                ReportBL.PlotBooleanValue(pdfGen, BilanConjointOuiNon, y, x += 145, "2");
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_No"), y, max_width, height, x += tabCheck);

                #endregion


                #region "Second row"

                //isnewpage = false;
                //yLast = y;
                //hGth = 4 * height + 40 + 4 * interline;
                //pdfGen.CalculeZoneWithAutomaticNewPage(ref y, hGth);


                // Avez-vous mis en place des solutions de retraite complémentaire ?

                string SolutionVousOuiNon = "";
                string SolutionVousDemarche = "";
                string SolutionConjointOuiNon = "";
                string SolutionConjointDemarche = "";
                string ReversionVousOuiNon = "";
                string ReversionConjointOuiNon = "";


                Vous = report.ReportOptionAttributeValue.Where(roav => roav.idOptionAttribute == 566).FirstOrDefault();
                if (Vous != null)
                {
                    SolutionVousOuiNon = Convert.ToString(Vous.CustomObjectValue.HasPensionPlan);
                    SolutionVousDemarche = Convert.ToString(Vous.CustomObjectValue.Reason);
                    ReversionVousOuiNon = Convert.ToString(Vous.CustomObjectValue.HasOptForRevision);
                }

                Conjoint =
                    report.ReportOptionAttributeValue.Where(roav => roav.idOptionAttribute == 567).FirstOrDefault();
                if (Conjoint != null)
                {
                    SolutionConjointOuiNon = Convert.ToString(Conjoint.CustomObjectValue.HasPensionPlan);
                    SolutionConjointDemarche = Convert.ToString(Conjoint.CustomObjectValue.Reason);
                    ReversionConjointOuiNon = Convert.ToString(Conjoint.CustomObjectValue.HasOptForRevision);
                }

                x = 0;
                y -= 25;
                ReportBL.PlotBooleanValue(pdfGen, SolutionVousOuiNon, y = y + 43, x += 190, "1");
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_Yes"), y, max_width, height, x += tabCheck);
                ReportBL.PlotBooleanValue(pdfGen, SolutionVousOuiNon, y, x += tabYesNo, "2");
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_No"), y, max_width, height, x += tabCheck);

                ReportBL.PlotBooleanValue(pdfGen, SolutionConjointOuiNon, y, x += 110, "1");
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_Yes"), y, max_width, height, x += tabCheck);
                ReportBL.PlotBooleanValue(pdfGen, SolutionConjointOuiNon, y, x += tabYesNo, "2");
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_No"), y, max_width, height, x += tabCheck);

                x = 0;
                pdfGen.AddDefaultText(
                    string.Format(languageDataPP.GetContent("PdfReportPP_210"), SolutionVousDemarche), y = y + interline,
                    max_width, height * 2, x += 190);
                pdfGen.AddDefaultText(
                    string.Format(languageDataPP.GetContent("PdfReportPP_210"), SolutionConjointDemarche), y, max_width,
                    height * 2, x += 155);

                x = 0;
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_211"), y += interline, max_width,
                    height * 2, x += 185);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_211"), y, max_width, height, x += 160);

                x = 0;
                ReportBL.PlotBooleanValue(pdfGen, ReversionVousOuiNon, y = y + interline, x += 190, "1");
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_Yes"), y, max_width, height, x += tabCheck);
                ReportBL.PlotBooleanValue(pdfGen, ReversionVousOuiNon, y, x += tabYesNo, "2");
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_No"), y, max_width, height, x += tabCheck);

                ReportBL.PlotBooleanValue(pdfGen, ReversionConjointOuiNon, y, x += 110, "1");
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_Yes"), y, max_width, height, x += tabCheck);
                ReportBL.PlotBooleanValue(pdfGen, ReversionConjointOuiNon, y, x += tabYesNo, "2");
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_No"), y, max_width, height, x += tabCheck);

                #endregion


                //Assurance individuelle ?
          
                if (!string.IsNullOrEmpty(hostCode) && hostCode == "BE")
                {
                    //hGth = 2*height + 40 + 20;
                    //pdfGen.CalculeZoneWithAutomaticNewPage(ref y, hGth);

                    string AssIndivVousOuiNon = "";
                    string AssIndivVousDate = "";
                    string AssIndivConjointOuiNon = "";
                    string AssIndivConjointDate = "";

                    var AssVous =
                        report.ReportOptionAttributeValue.Where(roav => roav.idOptionAttribute == 770).FirstOrDefault();
                    if (AssVous != null)
                    {
                        AssIndivVousOuiNon = Convert.ToString(AssVous.CustomObjectValue.HasInsuranceIndividualLife);
                        AssIndivVousDate = Convert.ToString(AssVous.CustomObjectValue.InsuranceIndividualLifeDate);
                    }

                    var AssConjoint =
                        report.ReportOptionAttributeValue.Where(roav => roav.idOptionAttribute == 771).FirstOrDefault();
                    if (AssConjoint != null)
                    {
                        AssIndivConjointOuiNon =
                            Convert.ToString(AssConjoint.CustomObjectValue.HasInsuranceIndividualLife);
                        AssIndivConjointDate =
                            Convert.ToString(AssConjoint.CustomObjectValue.InsuranceIndividualLifeDate);
                    }

                    x = 0;
                    ReportBL.PlotBooleanValue(pdfGen, AssIndivVousOuiNon, y = y + 40, x += 190, "1");
                    pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_Yes"), y, max_width, height,
                        x += tabCheck);
                    pdfGen.AddDefaultText(string.Format("Date : {0} ", AssIndivVousDate), y, max_width, height, x += 20);
                    ReportBL.PlotBooleanValue(pdfGen, AssIndivConjointOuiNon, y, x += 120, "1");
                    pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_Yes"), y, max_width, height,
                        x += tabCheck);
                    pdfGen.AddDefaultText(string.Format("Date : {0} ", AssIndivConjointDate), y, max_width, height,
                        x += 20);

                    x = 0;
                    ReportBL.PlotBooleanValue(pdfGen, AssIndivVousOuiNon, y = y + 20, x += 190, "2");
                    pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_No"), y, max_width, height,
                        x += tabCheck);
                    ReportBL.PlotBooleanValue(pdfGen, AssIndivConjointOuiNon, y, x += 140, "2");
                    pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_No"), y, max_width, height,
                        x += tabCheck);
                }
                //---------------> changer ce y 

                //y = yLast;
               // pdfGen.CurrentPage = currentPageNumber-1;
                //AddRetraitePPTable(pdfGen, ref y, 0);

                y += 30;
                //pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(languageDataPP.GetContent("PdfReportPP_Notes"), y, 500, 20);
                //pdfGen.AddRecueil_Notes_Rectangle(y += interline, 0, max_width);
                //pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(GetReportOptionAttributeValueByIdOptionAttribute(563, report), y += 5, 480, 65, 5);


                var montantFrequence = "";

                var freq =
                    report.ReportOptionAttributeValue.Where(roav => roav.idOptionAttribute == 569).FirstOrDefault();
                if (freq != null)
                {
                    montantFrequence = GetEnumValue(Convert.ToString(freq.CustomObjectValue.Frequency), 3);
                }
                else // mensuel par défaut
                {
                    montantFrequence = report.IsEmptyReport
                        ? string.Empty
                        : LanguageContentBL.Translate("Frequency2_Enum_001");
                }

                pdfGen.AddDefaultText(string.Format(languageDataPP.GetContent("PdfReportPP_212"),
                    report.IsEmptyReport ? "       " : GetReportOptionAttributeValueByIdOptionAttribute(568, report)
                    , montantFrequence)
                    , y, max_width, height);

                var revenuFrequence = "";

                freq = report.ReportOptionAttributeValue.Where(roav => roav.idOptionAttribute == 572).FirstOrDefault();
                if (freq != null)
                {
                    revenuFrequence = GetEnumValue(Convert.ToString(freq.CustomObjectValue.Frequency), 15);
                }
                else // mensuel par défaut
                {
                    revenuFrequence = report.IsEmptyReport
                        ? string.Empty
                        : LanguageContentBL.Translate("Frequency2_Enum_001");
                }

                pdfGen.AddDefaultText(string.Format(languageDataPP.GetContent("PdfReportPP_213"),
                    report.IsEmptyReport ? "       " : GetReportOptionAttributeValueByIdOptionAttribute(570, report)
                    , report.IsEmptyReport ? "       " : GetReportOptionAttributeValueByIdOptionAttribute(571, report)
                    , revenuFrequence)
                    , y += interline, max_width, height);

                var revenuFuturFrequence = "";

                freq = report.ReportOptionAttributeValue.Where(roav => roav.idOptionAttribute == 574).FirstOrDefault();
                if (freq != null)
                {
                    revenuFuturFrequence = GetEnumValue(Convert.ToString(freq.CustomObjectValue.Frequency), 3);
                }
                else // mensuel par défaut
                {
                    revenuFuturFrequence = report.IsEmptyReport
                        ? string.Empty
                        : LanguageContentBL.Translate("Frequency2_Enum_001");
                }


                pdfGen.AddDefaultText(string.Format(languageDataPP.GetContent("PdfReportPP_214"),
                    report.IsEmptyReport ? "       " : GetReportOptionAttributeValueByIdOptionAttribute(573, report)
                    , revenuFuturFrequence)
                    , y += interline, max_width, height);


                x = 0;
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_215"), y += interline, max_width, height);
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(926, report), y, x += 235);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_Yes"), y,
                    max_width, height, x += tabCheck);
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(927, report), y, x += tabYesNo);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_No"), y, max_width, height, x += tabCheck);

                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_216"), y += interline, max_width, height);

                x = 0;
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(929, report), y, x += 235);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_Yes"), y, max_width, height, x += tabCheck);
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(930, report), y, x += tabYesNo);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_No"), y, max_width, height, x += tabCheck);

                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_217"), y += interline, max_width, height);

                x = 0;
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(932, report), y += interline, x);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_189"), y, max_width, height * 2,
                    x += tabYesNo); //dES SUPPORTS

                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(933, report), y, x += 120);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_190"), y, max_width, height * 2,
                    x += tabYesNo);

                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(934, report), y, x += 100);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_191"), y, max_width, height * 2,
                    x += tabYesNo);

                //Contrat epargne
                //pdfGen.CreatePage();
                //y = 0;
                y += interline + 10;
                pdfGen.AddDefaultTextWithAutomaticNewPage(string.Format(languageDataPP.GetContent("PdfReportPP_218")), ref y,
                    max_width, height);

                y += interline + 5;
                GenerateContratsEpargneTable1(pdfGen, report, ref y, pIsEmptyReport);

                // NOT FOUND IN UI
                //pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(languageDataPP.GetContent("PdfReportPP_Notes"), y += 160, 500, 20);
                //pdfGen.AddRecueil_Notes_Rectangle(y += interline, 0, max_width);
                //pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(GetReportOptionAttributeValueByIdOptionAttribute(0, report), y += 5, 480, 65, 10);

                y += interline;
                //float yPlus = 135;
                //if (Upsilab.Business.Utility.ConfigurationManager.ExtranetHostCode ==
                //    Upsilab.Business.Utility.PageLanguageHelper.HostCode.BE.ToString())
                //    yPlus = 115;

                //y += yPlus;
                GenerateContratsEpargneTable2(pdfGen, report, ref y);

                y += interline + 10;
                string noteValue = GetReportOptionAttributeValueByIdOptionAttribute(563, report);
                    pdfGen.DynamicBlueBorderZoneSize(noteValue, y, out oHeight);
                y = y + interline;
                yTmp = y;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, oHeight);

                if(y > 0) y = yTmp;

                pdfGen.AddLabelNote(languageDataPP.GetContent("PdfReportPP_Notes"), y, 500, 20);
                y += interline;
                pdfGen.AddDynamicBlueBorderWithText(noteValue, ref y, 0, max_width,50);

                //bool beakExist = noteValue.Contains(((char)13));

            }
            #endregion

            #region "g) Prévoyance"
            if (listIdOptionAttributes.Any(ioa => ioa == 241) || pIsEmptyReport)
            {
                //y = 0;
                //pdfGen.CreatePage();
                y = y + interline;
                yTmp = y;

                float hGht = (10f* height);

                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, hGht);
                if (y > 0) y = yTmp;
                pdfGen.AddOrangeTitleWithAutomaticNewPage(string.Format("{0} {1}", NextIndexation(), languageDataPP.GetContent("PdfReportPP_219").Replace("g)", string.Empty)), ref y, 500, 20, 15);//g) Prévoyance (rentes conjoints, indemnités journalières, capital-décès, etc)

                string VousComplementaireSante = "";
                string VousComplementaireSanteNiveau = "";
                string VousPrevoyance = "";
                string VousForfait = "";
                string VousPendant = "";
                string VousSalaireBrut = "";
                string VousFranchises = "";
                string VousCotiAnnuel1 = "";
                string VousCotiAnnuel2 = "";
                string VousCompany1 = "";
                string VousCompany2 = "";
                string VousDateEcheance1 = "";
                string VousDateEcheance2 = "";
                var Vous = report.ReportOptionAttributeValue.FirstOrDefault(roav => roav.idOptionAttribute == 588);
                if (Vous != null)
                {
                    VousComplementaireSante = Convert.ToString(Vous.CustomObjectValue.ComplementaryHealthContractType);
                    VousComplementaireSanteNiveau = Convert.ToString(Vous.CustomObjectValue.ComplementaryHealthGuaranteeType);
                    VousPrevoyance = Convert.ToString(Vous.CustomObjectValue.InsuranceContractType);
                    VousForfait = report.IsEmptyReport ? "        " : Convert.ToString(Vous.CustomObjectValue.InsurancePlan);
                    VousPendant = report.IsEmptyReport ? "        " : Convert.ToString(Vous.CustomObjectValue.InsuranceDuration);
                    VousSalaireBrut = Convert.ToString(Vous.CustomObjectValue.InsuranceGrossPercentage);
                    VousFranchises = Convert.ToString(Vous.CustomObjectValue.InsuranceFranchise);
                    VousCotiAnnuel1 = Convert.ToString(Vous.CustomObjectValue.ComplementaryHealthCurrentContribution); ;
                    VousCotiAnnuel2 = Convert.ToString(Vous.CustomObjectValue.InsuranceCurrentContribution);
                    VousCompany1 = Convert.ToString(Vous.CustomObjectValue.ComplementaryHealthCompany);
                    VousCompany2 = Convert.ToString(Vous.CustomObjectValue.InsuranceCompany);
                    VousDateEcheance1 = Convert.ToString(Vous.CustomObjectValue.ComplementaryHealthMaturityDate);
                    VousDateEcheance2 = Convert.ToString(Vous.CustomObjectValue.InsuranceMaturityDate);

                }

                AddPrevoyanceTable1(pdfGen, y += interline + 5);
                x = 230;
                ReportBL.PlotBooleanValue(pdfGen, VousComplementaireSante, y += interline, x, "1");
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_220"), y, max_width, height, x += tabYesNo);
                ReportBL.PlotBooleanValue(pdfGen, VousComplementaireSanteNiveau, y, x += 120, "1");
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_221"), y, max_width, height, x += tabYesNo);
                ReportBL.PlotBooleanValue(pdfGen, VousComplementaireSanteNiveau, y, x += 50, "2");
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_222"), y, max_width, height, x += tabYesNo);


                x = 230;
                ReportBL.PlotBooleanValue(pdfGen, VousComplementaireSante, y += interline, x, "2");
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_223"), y, max_width, height, x + tabYesNo);
                ReportBL.PlotBooleanValue(pdfGen, VousComplementaireSanteNiveau, y, x += 140, "3");
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_224"), y, max_width, height, x += tabYesNo);


                x = 230;
                ReportBL.PlotBooleanValue(pdfGen, VousPrevoyance, y += 30, x, "1");
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_220"), y, max_width, height, x += tabYesNo);

                pdfGen.AddDefaultText(string.Format(languageDataPP.GetContent("PdfReportPP_225"), VousForfait), y - 15, max_width, height, x += 110);
                pdfGen.AddDefaultText(string.Format(languageDataPP.GetContent("PdfReportPP_483"), VousPendant), y - 15 + interline, max_width, height, x);
                pdfGen.AddDefaultText(string.Format(languageDataPP.GetContent("PdfReportPP_484"), VousSalaireBrut), y - 15 + (interline * 2), max_width, height, x);
                pdfGen.AddDefaultText(string.Format(languageDataPP.GetContent("PdfReportPP_485"), VousFranchises), y - 15 + (interline * 3), max_width, height, x);

                x = 230;
                ReportBL.PlotBooleanValue(pdfGen, VousPrevoyance, y += interline, x, "2");
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_223"), y, max_width, height, x + tabYesNo);

                x = 230;
                pdfGen.AddDefaultText(string.Format("{0}",
                   VousCotiAnnuel1)
                  , y += 35, max_width, height, x);
                pdfGen.AddDefaultText(string.Format("{0}",
                VousCotiAnnuel2)
                , y, max_width, height, x += 140);

                x = 230;
                pdfGen.AddDefaultText(string.Format("{0}",
                   VousCompany1)
                  , y += 20, max_width, height, x);
                pdfGen.AddDefaultText(string.Format("{0}",
                 VousCompany2)
                , y, max_width, height, x += 140);

                x = 230;
                pdfGen.AddDefaultText(string.Format("{0}",
                  VousDateEcheance1)
                  , y += 20, max_width, height, x);
                pdfGen.AddDefaultText(string.Format("{0}",
                 VousDateEcheance2)
                , y, max_width, height, x += 140);

                //:**************** PREVOYANCE VOTRE CONJOINT **********//////////:

                string ConjointComplementaireSante = "";
                string ConjointComplementaireSanteNiveau = "";
                string ConjointPrevoyance = "";
                string ConjointForfait = "";
                string ConjointPendant = "";
                string ConjointSalaireBrut = "";
                string ConjointFranchises = "";
                string ConjointCotiAnnuel1 = "";
                string ConjointCotiAnnuel2 = "";
                string ConjointCompany1 = "";
                string ConjointCompany2 = "";
                string ConjointDateEcheance1 = "";
                string ConjointDateEcheance2 = "";

                var Conjoint = report.ReportOptionAttributeValue.Where(roav => roav.idOptionAttribute == 589).FirstOrDefault();
                if (Conjoint != null)
                {
                    ConjointComplementaireSante = Convert.ToString(Conjoint.CustomObjectValue.ComplementaryHealthContractType);
                    ConjointComplementaireSanteNiveau = Convert.ToString(Conjoint.CustomObjectValue.ComplementaryHealthGuaranteeType);
                    ConjointPrevoyance = Convert.ToString(Conjoint.CustomObjectValue.InsuranceContractType);
                    ConjointForfait = report.IsEmptyReport ? "        " : Convert.ToString(Conjoint.CustomObjectValue.InsurancePlan);
                    ConjointPendant = report.IsEmptyReport ? "        " : Convert.ToString(Conjoint.CustomObjectValue.InsuranceDuration);
                    ConjointSalaireBrut = Convert.ToString(Conjoint.CustomObjectValue.InsuranceGrossPercentage);
                    ConjointFranchises = Convert.ToString(Conjoint.CustomObjectValue.InsuranceFranchise);
                    ConjointCotiAnnuel1 = Convert.ToString(Conjoint.CustomObjectValue.ComplementaryHealthCurrentContribution); ;
                    ConjointCotiAnnuel2 = Convert.ToString(Conjoint.CustomObjectValue.InsuranceCurrentContribution);
                    ConjointCompany1 = Convert.ToString(Conjoint.CustomObjectValue.ComplementaryHealthCompany);
                    ConjointCompany2 = Convert.ToString(Conjoint.CustomObjectValue.InsuranceCompany);
                    ConjointDateEcheance1 = Convert.ToString(Conjoint.CustomObjectValue.ComplementaryHealthMaturityDate);
                    ConjointDateEcheance2 = Convert.ToString(Conjoint.CustomObjectValue.InsuranceMaturityDate);

                }

                y = y + interline+10;
                yTmp = y;

                hGht = (10f * height);

                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, hGht);
                if (y > 0) y = yTmp;

                AddPrevoyanceTable2(pdfGen, y);
                x = 230;
                ReportBL.PlotBooleanValue(pdfGen, ConjointComplementaireSante, y += interline, x, "1");
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_220"), y, max_width, height, x += tabYesNo);
                ReportBL.PlotBooleanValue(pdfGen, ConjointComplementaireSanteNiveau, y, x += 120, "1");
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_221"), y, max_width, height, x += tabYesNo);
                ReportBL.PlotBooleanValue(pdfGen, ConjointComplementaireSanteNiveau, y, x += 50, "2");
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_222"), y, max_width, height, x += tabYesNo);

                x = 230;
                ReportBL.PlotBooleanValue(pdfGen, ConjointComplementaireSante, y += interline, x, "2");
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_223"), y, max_width, height, x + tabYesNo);
                ReportBL.PlotBooleanValue(pdfGen, ConjointComplementaireSanteNiveau, y, x += 140, "3");
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_224"), y, max_width, height, x += tabYesNo);

                x = 230;
                ReportBL.PlotBooleanValue(pdfGen, ConjointPrevoyance, y += 30, x, "1");
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_220"), y, max_width, height, x += tabYesNo);

                pdfGen.AddDefaultText(string.Format(languageDataPP.GetContent("PdfReportPP_225"), ConjointForfait), y - 15, max_width, height, x += 110);
                pdfGen.AddDefaultText(string.Format(languageDataPP.GetContent("PdfReportPP_483"), ConjointPendant), y - 15 + interline, max_width, height, x);
                pdfGen.AddDefaultText(string.Format(languageDataPP.GetContent("PdfReportPP_484"), ConjointSalaireBrut), y - 15 + (interline * 2), max_width, height, x);
                pdfGen.AddDefaultText(string.Format(languageDataPP.GetContent("PdfReportPP_485"), ConjointFranchises), y - 15 + (interline * 3), max_width, height, x);

                x = 230;
                ReportBL.PlotBooleanValue(pdfGen, ConjointPrevoyance, y += interline, x, "2");
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_223"), y, max_width, height, x + tabYesNo);

                x = 230;
                pdfGen.AddDefaultText(string.Format("{0}",
                   ConjointCotiAnnuel1)
                  , y += 35, max_width, height, x);
                pdfGen.AddDefaultText(string.Format("{0}",
                ConjointCotiAnnuel2)
                , y, max_width, height, x += 140);

                x = 230;
                pdfGen.AddDefaultText(string.Format("{0}",
                   ConjointCompany1)
                  , y += 20, max_width, height, x);
                pdfGen.AddDefaultText(string.Format("{0}",
                ConjointCompany2)
                , y, max_width, height, x += 140);

                x = 230;
                pdfGen.AddDefaultText(string.Format("{0}",
                   ConjointDateEcheance1)
                  , y += 20, max_width, height, x);
                pdfGen.AddDefaultText(string.Format("{0}",
              ConjointDateEcheance2)
                , y, max_width, height, x += 140);

                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, 20 + 65 + 10);
                if (y > 0)
                {
                    y += 10;
                }

                string noteValue = GetReportOptionAttributeValueByIdOptionAttribute(587, report);
                pdfGen.DynamicBlueBorderZoneSize(noteValue, y, out oHeight);
                yTmp = y + interline;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, oHeight);

                if (y > 0) y = yTmp;

                pdfGen.AddLabelNote(languageDataPP.GetContent("PdfReportPP_Notes"), y, 500, 20);
                y += interline;
                pdfGen.AddDynamicBlueBorderWithText(noteValue, ref y, 0, max_width,50);
            }

            #endregion

        }