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

        }
        private static void GeneratePPChargesDiverses(FoxitPDFGenerator pdfGen, Data.Model.Report report, ref float y, bool pIsEmptyReport)
        {
            const string key = "charge";
            var languageDataPP = PageLanguageHelper.GetLanguageContent("User", "PDFReportPP");
            var languageDataCredit = PageLanguageHelper.GetLanguageContent("User", "ClientPP_Credit");

            float x = 0;

            Func<float, float, int, int, string, bool> BlockQuestion = (yp, x1, yes, no, t) =>
            {
                var reportAnyyes = GetReportOptionValueByIdOption(yes, report);
                pdfGen.AddDefaultText(languageDataCredit.GetContent(t), yp, 200, height, x1 += padding_left);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_Yes"), yp, max_width, height, x1 += 250);
                ReportBL.PlotBooleanValue(pdfGen, reportAnyyes, yp, x1 = x1 + tabCheck + 5);
                pdfGen.AddDefaultText(languageDataPP.GetContent("PdfReportPP_No"), yp, max_width, height,
                    x1 = x1 + tabYesNo);
                ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(no, report), yp, x1 = x1 + tabCheck + 5);
                return reportAnyyes != null;
            };

            Func<float, float, int, string, string> BlockMontant = (yp, xt, idx, t) =>
            {
                /*pdfGen.AddDefaultText(languageDataCredit.GetContent(t).Replace("&euro;", "€"), yp, 200, height,
                    x1 += padding_left);
                string liquidity = GetReportOptionAttributeValueByIdOptionAttribute(idx, report);
                liquidity = !string.IsNullOrEmpty(liquidity) ? liquidity : "0";
                pdfGen.AddAnswer(liquidity, yp, 75, 20, x1 += 250);
                return string.Empty;*/

                string montant = GetReportOptionAttributeValueByIdOptionAttribute(idx, report);
                if (!pIsEmptyReport)
                {
                    if (!string.IsNullOrEmpty(montant) && !montant.Equals("0"))
                    {
                        pdfGen.AddDefaultText(languageDataCredit.GetContent(t).Replace("&euro;", "€"), yp, max_width, height, xt += padding_left);
                        pdfGen.AddAnswer(montant, yp, 75, 20, xt += 270);
                    }
                }
                else
                {
                    pdfGen.AddDefaultText(languageDataCredit.GetContent(t).Replace("&euro;", "€"), yp, max_width, height, xt += padding_left);
                    pdfGen.AddAnswer(string.Empty, yp, 75, 20, xt += 270);
                }
                return string.Empty;
            };

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

            //CHARGES DIVERSES
            pdfGen.AddTitle(languageDataPP.GetContent("PdfReportPP_132"), y, max_width, 20);
            // chargges estimés
            //string chargeV = GetReportOptionAttributeValueByIdOptionAttribute(730, report);
            //pdfGen.AddDefaultText(string.Format(languageDataPP.GetContent("PdfReportPP_charges"), string.Empty), y += paddingAfterParagraph, max_width, 20, 30);
            //x = 250;
            //pdfGen.AddAnswer(chargeV, y, 75, 20, x);

            //x = 0;
            //ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(365, report), y += paddingAfterParagraph, x);
            //pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(languageDataPP.GetContent("PdfReportPP_Equals0"), y, max_width, height, x += tabCheck);

            //ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(366, report), y, x += 30);
            //pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(languageDataPP.GetContent("PdfReportPP_Inf100"), y, max_width, height, x += tabCheck);

            //ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(367, report), y, x += 50);
            //pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(languageDataPP.GetContent("PdfReportPP_Entre100Et250"), y, max_width, height, x += tabCheck);

            //ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(368, report), y, x += 80);
            //pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(languageDataPP.GetContent("PdfReportPP_Entre100Et250"), y, max_width, height, x += tabCheck);

            //ReportBL.PlotBooleanValue(pdfGen, GetReportOptionValueByIdOption(369, report), y, x += 80);
            //pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(languageDataPP.GetContent("PdfReportPP_Sup500"), y, max_width, height, x += tabCheck);

            #region "I-Impôts et taxes"



            x = 0;
            //I. Impôts et taxes (impôt sur ...)
            pdfGen.AddSubtitle(languageDataPP.GetContent("PdfReportPP_133"), y += (1f*interline), max_width, height,ChapiterPaddingLeft); 
            var hasClientImposable = GetReportOptionValueByIdOption(1311, report) != null;
            var hasDetailClientImposable = GetReportOptionValueByIdOption(1313, report) != null;
            if (!pIsEmptyReport)
            {
                if (hasClientImposable)
                {
                    if (!hasDetailClientImposable)
                    {
                        y += interline;
                        BlockQuestion(y, x, 1311, 1312, "ClientPP_Credit_025");
                        x = 0;
                        //Impôts et taxes (en K&euro;)
                        y += interline;
                        BlockMontant(y, x, 730, "ClientPP_Credit_026");
                    }
                    else
                    {
                        y += paddingAfterParagraph;
                        BuilImpotsEtTaxesTableFixIssue9985(pdfGen, report, ref y, pIsEmptyReport);
                    }
                }
                else
                {
                    //Impôts et taxes (en K&euro;)
                    y += interline;
                    BlockMontant(y, x, 730, "ClientPP_Credit_026");
                }
            }
            else
            { // EMPTY REPORT IMPOTS ET TAXES
                y += interline;
                BlockQuestion(y, x, 1311, 1312, "ClientPP_Credit_025");
                x = 0;
                //Impôts et taxes (en K&euro;):
                y += interline;
                BlockMontant(y, x, 730, "ClientPP_Credit_026");

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

            /*if ((hasClientImposable && hasDetailClientImposable) || pIsEmptyReport)
            {
                y += paddingAfterParagraph;
                BuilImpotsEtTaxesTableFixIssue9985(pdfGen, report, ref y, pIsEmptyReport);
            }*/

            #endregion

            #region "II-Autres engagements financiers"

            y += interline+10;
            yTmp = y;
            pdfGen.CalculeZoneWithAutomaticNewPage(ref y, 50);
            if (y > 0) y = yTmp;
            pdfGen.AddSubtitleWithAutomaticNewPage(languageDataPP.GetContent("PdfReportPP_134"), ref y, max_width,
                height, ChapiterPaddingLeft); //II. Autres engagements financiers

            var hasEngamentFinancier = GetReportOptionValueByIdOption(1315, report) != null;
            var hasDetailEngamentFinancier = GetReportOptionValueByIdOption(1317, report) != null;
            if (!pIsEmptyReport)
            {
                if (hasEngamentFinancier)
                {
                    if (!hasDetailEngamentFinancier)
                    {
                        y += interline;
                        yTmp = y;
                        pdfGen.CalculeZoneWithAutomaticNewPage(ref y, height);
                        if (y > 0) y = yTmp;
                        BlockQuestion(y, x, 1315, 1316, "ClientPP_Credit_028");

                        x = 0;
                        //Patrimoine financier (en €):
                        y += interline;
                        yTmp = y;
                        pdfGen.CalculeZoneWithAutomaticNewPage(ref y, height);
                        if (y > 0) y = yTmp;
                        BlockMontant(y, x, 905, "ClientPP_Credit_029");
                    }
                    else
                    {
                        #region "a) Engagements en cours"

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

                            // y += interline;
                            pdfGen.AddTextBoldSubtitle(languageDataPP.GetContent("PdfReportPP_135"), y, max_width, height, padding_left);
                            y += paddingAfterParagraph;
                            GenerateEngagementsEncoursTableFixIssue9985(pdfGen, report, ref y, pIsEmptyReport);

                        #endregion


                        #region "b) Projets d’investissement"

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

                            pdfGen.AddTextBoldSubtitle(languageDataPP.GetContent("PdfReportPP_136"), y, max_width, height, padding_left);
                            y += paddingAfterParagraph;
                            GenerateProjetInvestissementTableFixIssue9985(pdfGen, report, ref y, pIsEmptyReport);

                        #endregion
                    }
                }
                else
                {
                    x = 0;
                    //Patrimoine financier (en €):
                    y += interline;
                    yTmp = y;
                    pdfGen.CalculeZoneWithAutomaticNewPage(ref y, height);
                    if (y > 0) y = yTmp;
                    BlockMontant(y, x, 905, "ClientPP_Credit_029");
                }
            }
            else
            { // EMPTY REPORT ENGAGEMENT FINANCIER
                y += interline;
                yTmp = y;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, height);
                if (y > 0) y = yTmp;
                BlockQuestion(y, x, 1315, 1316, "ClientPP_Credit_028");

                x = 0;
                //Patrimoine financier (en €):
                y += interline;
                yTmp = y;
                pdfGen.CalculeZoneWithAutomaticNewPage(ref y, height);
                if (y > 0) y = yTmp;
                BlockMontant(y, x, 905, "ClientPP_Credit_029");

                #region "a) Engagements en cours"

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

                // y += interline;
                pdfGen.AddTextBoldSubtitle(languageDataPP.GetContent("PdfReportPP_135"), y, max_width, height, padding_left);
                y += paddingAfterParagraph;
                GenerateEngagementsEncoursTableFixIssue9985(pdfGen, report, ref y, pIsEmptyReport);

                #endregion


                #region "b) Projets d’investissement"

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

                pdfGen.AddTextBoldSubtitle(languageDataPP.GetContent("PdfReportPP_136"), y, max_width, height, padding_left);
                y += paddingAfterParagraph;
                GenerateProjetInvestissementTableFixIssue9985(pdfGen, report, ref y, pIsEmptyReport);

                #endregion
            }

            /*if ((hasEngamentFinancier && hasDetailEngamentFinancier) || pIsEmptyReport)
            {
                #region "a) Engagements en cours"

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

               // y += interline;
                pdfGen.AddTextBoldSubtitle(languageDataPP.GetContent("PdfReportPP_135"), y, max_width, height, padding_left);
                y += paddingAfterParagraph;
                GenerateEngagementsEncoursTableFixIssue9985(pdfGen, report, ref y, pIsEmptyReport);

                #endregion


                #region "b) Projets d’investissement"

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

                pdfGen.AddTextBoldSubtitle(languageDataPP.GetContent("PdfReportPP_136"), y, max_width, height, padding_left);
                y += paddingAfterParagraph;
                GenerateProjetInvestissementTableFixIssue9985(pdfGen, report, ref y, pIsEmptyReport);

                #endregion

            }*/

        #endregion

            //pdfGen.AddReceuil_DefaultText_Justify_CalibriBold_Blue_Label(languageDataPP.GetContent("PdfReportPP_Notes"), y += 100, max_width, height);
            //pdfGen.AddRecueil_Notes_Rectangle(y += interline, 0, max_width, 35);
            //pdfGen.AddReceuil_DefaultText_Justify_Calibri_Label(ReportBL.GetStringValue(GetReportOptionAttributeValueByIdOptionAttributeAndIdReport(271, report)), y + 5, 480, 65, 10);

            y += interline;
            
            yTmp = y + interline;
            string noteValue = ReportBL.GetStringValue(GetReportOptionAttributeValueByIdOptionAttribute(271, report));
            float oHeight = 0;

            pdfGen.DynamicBlueBorderZoneSize(noteValue,y,out oHeight);
            pdfGen.CalculeZoneWithAutomaticNewPage(ref y, oHeight+height);
            if (y > 0) y = yTmp;

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