lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Group-quote PDF: whitespace changes, and enhancement


From: Vadim Zeitlin
Subject: Re: [lmi] Group-quote PDF: whitespace changes, and enhancement
Date: Fri, 9 Mar 2018 12:32:12 +0100

On Fri, 9 Mar 2018 02:50:58 +0000 Greg Chicares <address@hidden> wrote:

GC> On 2018-03-09 00:17, Vadim Zeitlin wrote:
GC> > On Thu, 8 Mar 2018 15:38:46 +0000 Greg Chicares <address@hidden> wrote:
GC> > 
GC> > GC> Can the new PDF similarly apportion the available blank space (on
GC> > GC> the right) among all columns?
GC> 
GC> In effect, PR #74 has already done what we wanted: the sixth page
GC> (page 5 of 8) of that 'large-in-dollars' input file we shared now
GC> looks as though you had apportioned all available space among the
GC> columns, when AIUI all you really did was widen them.

 Yes, exactly.

GC> I've gone ahead and committed that PR,

 Thanks!

GC> but I think it needs more
GC> refinement--I ran 'large-in-dollars.ill' and got a couple warnings
GC> (which I won't retype here because 'wine' makes it onerous, and I
GC> imagine you'll see them yourself),

 Hmm, no, I don't. But I'll retry under Wine later.

GC> and on the fifth page (4 of 7) the numeric columns exceed the available
GC> page width.

 And I don't see this neither. I do see the overlap between "Investment
Income" and "Account Value" columns however (sorry for not noticing it
before), but this is indeed due to not giving these columns enough space
and is fixed by your patch below.

GC> I don't yet understand how all this code works, but I'd guess that
GC> there might be too many hard-coded spaces between columns.

 The code works by starting with relatively generous (1em) margins which
are decreased by up to 50% if there is not enough space to fit everything.
 
GC> >  Wouldn't this look really ugly for narrow(er) tables that also occur in
GC> > illustrations (e.g. supplemental reports with just 3 columns)?
GC> 
GC> Yes, it would. I believe that for the calculation summary we decided
GC> to expand the spacing between columns so that all available width is
GC> consumed.

 This is indicated explicitly by making one (or more) column(s)
variable-sized, i.e. using a similar idea as for wxSizer proportions. For
the illustration tables all columns have fixed size.


GC> [0] "the patch below": I wouldn't propose to commit this as is; it's
GC> intended only to suggest some changes and raise some questions. The
GC> major issue is whether these "999..." fields apply only to a single
GC> page, or are generic (i.e. so that the same width would be used for
GC> a user-designed supplemental report).

 All supplemental report columns currently use "999,999" to compute their
width, which is surely wrong in the light of this discussion. For now I
think we have no choice but to replace it with "999,999,999", but in the
future I think we should consider to defining the columns metadata in one
place and using it from both standard_supplemental_report (where this
"999,999" is currently hard-coded) and the other page classes.

GC> Either way, I'm sure this is not what we want:
GC>   ,{ "ErGrossPmt"           , "ER Gross\nPayment"          ,     "999,999" }
GC>   ,{ "EeGrossPmt"           , "EE Gross\nPayment"          ,     "999,999" }
GC>   ,{ "GrossPmt"             , "Premium\nOutlay"            , "999,999,999" }
GC> the last of those three is more or less the sum of the first two.

 This is exactly the kind of knowledge that I'm lacking and which is why I
think it would be simpler and better if you adjusted the widths of various
columns yourself, to be sure they make sense and are consistent with each
other.

GC> 
---------8<--------8<--------8<--------8<--------8<--------8<--------8<-------
GC> diff --git a/ledger_pdf_generator_wx.cpp b/ledger_pdf_generator_wx.cpp
GC> index 545d1bcf..72ff9550 100644
GC> --- a/ledger_pdf_generator_wx.cpp
GC> +++ b/ledger_pdf_generator_wx.cpp
GC> @@ -1895,7 +1895,7 @@ class ill_reg_tabular_detail2_page : public 
page_with_tabular_report
GC>              {{ "PolicyYear"          , "Policy\nYear"               ,      
   "999" }
GC>              ,{ "AttainedAge"         , "End of\nYear Age"           ,      
   "999" }
GC>              ,{ "AnnGAIntRate_Current", "Illustrated\nCrediting Rate",      
"99.99%" }
GC> -            ,{ "SpecAmt"             , "Selected\nFace Amount"      , 
"999,000,000" }
GC> +            ,{ "SpecAmt"             , "Selected\nFace Amount"      , 
"999,999,999" }
GC>              };

 Sure, it won't change much in practice, but it's better to be consistent
and I think these zeroes were just a typo in the first place.

GC>          return columns;
GC> @@ -1956,6 +1956,7 @@ class standard_supplemental_report : public 
page_with_tabular_report
GC>                      (illustration_table_column
GC>                          {std::move(name)
GC>                          
,interpolate_html.evaluate("SupplementalReportColumnsTitles", i)
GC> +// Vadim--should this become "999,999,999"?
GC>                          ,"999,999"
GC>                          }
GC>                      );

 Yes, I think so.

GC> @@ -2386,17 +2387,17 @@ class nasd_supplemental : public 
page_with_tabular_report
GC>          static illustration_table_columns const columns =
GC>              {{ "PolicyYear"           , "Policy\nYear"               ,     
    "999" }
GC>              ,{ "AttainedAge"          , "End of\nYear Age"           ,     
    "999" }
GC> -            ,{ "ErGrossPmt"           , "ER Gross\nPayment"          ,     
"999,999" }
GC> -            ,{ "EeGrossPmt"           , "EE Gross\nPayment"          ,     
"999,999" }
GC> +            ,{ "ErGrossPmt"           , "ER Gross\nPayment"          , 
"999,999,999" }
GC> +            ,{ "EeGrossPmt"           , "EE Gross\nPayment"          , 
"999,999,999" }
GC>              ,{ "GrossPmt"             , "Premium\nOutlay"            , 
"999,999,999" }
GC> -            ,{ "PolicyFee_Current"    , "Admin\nCharge"              ,     
"999,999" }
GC> -            ,{ "PremTaxLoad_Current"  , "Premium\nTax Load"          ,     
"999,999" }
GC> -            ,{ "DacTaxLoad_Current"   , "DAC\nTax Load"              ,     
"999,999" }
GC> -            ,{ "ErModalMinimumPremium", "ER Modal\nMinimum\nPremium" ,     
"999,999" }
GC> -            ,{ "EeModalMinimumPremium", "EE Modal\nMinimum\nPremium" ,     
"999,999" }
GC> -            ,{ "NetPmt_Current"       , "Net\nPremium"               ,     
"999,999" }
GC> -            ,{ "COICharge_Current"    , "Cost of\nInsurance\nCharges",     
"999,999" }
GC> -            ,{ "AcctVal_Current"      , "Current\nAccount\nValue"    ,     
"999,999" }
GC> +            ,{ "PolicyFee_Current"    , "Admin\nCharge"              , 
"999,999,999" }
GC> +            ,{ "PremTaxLoad_Current"  , "Premium\nTax Load"          , 
"999,999,999" }
GC> +            ,{ "DacTaxLoad_Current"   , "DAC\nTax Load"              , 
"999,999,999" }
GC> +            ,{ "ErModalMinimumPremium", "ER Modal\nMinimum\nPremium" , 
"999,999,999" }
GC> +            ,{ "EeModalMinimumPremium", "EE Modal\nMinimum\nPremium" , 
"999,999,999" }
GC> +            ,{ "NetPmt_Current"       , "Net\nPremium"               , 
"999,999,999" }
GC> +            ,{ "COICharge_Current"    , "Cost of\nInsurance\nCharges", 
"999,999,999" }
GC> +            ,{ "AcctVal_Current"      , "Current\nAccount\nValue"    , 
"999,999,999" }
GC>              ,{ "CSVNet_Current"       , "Current\nCash Surr\nValue"  , 
"999,999,999" }
GC>              ,{ "EOYDeathBft_Current"  , "Current\nDeath\nBenefit"    , 
"999,999,999" }
GC>              };

 If all of these fields need to be that wide, this is correct, of course,
but I worry if they still fit on the page. Have you already tested that
they do by chance or should I?

GC> @@ -2471,6 +2472,7 @@ class nasd_assumption_detail : public 
page_with_tabular_report
GC>          static illustration_table_columns const columns =
GC>              {{ "PolicyYear"          , "Policy\nYear"                ,     
   "999" }
GC>              ,{ "AttainedAge"         , "End of\nYear Age"            ,     
   "999" }
GC> +// Kim--It's "Inv Rate" in XSL-FO too, but should it be "Int" rate?
GC>              ,{ "AnnSAIntRate_Current", "Sep Acct Net\nInv Rate"      ,     
"99.99%" }
GC>              ,{ "AnnGAIntRate_Current", "Gen Acct\nCurrent Rate"      ,     
"99.99%" }
GC>              ,{ "CurrMandE"           , "M&E"                         ,     
"99.99%" }
GC> @@ -2746,6 +2748,9 @@ class reg_d_individual_guar_irr : public 
reg_d_individual_irr_base
GC>              ,{ "GrossPmt"                   , "Premium\nOutlay"    , 
"999,999,999" }
GC>              ,{ "CSVNet_GuaranteedZero"      , "Cash Surr\nValue"   , 
"999,999,999" }
GC>              ,{ "EOYDeathBft_GuaranteedZero" , "Death\nBenefit"     , 
"999,999,999" }
GC> +// Vadim--IRRs can easily run into thousands of percent. Is it
GC> +// necessary to try to determine a maximum value? (There are
GC> +// other IRRs elsewhere in this file, too.)
GC>              ,{ "IrrCsv_GuaranteedZero"      , "IRR on\nSurr Value" ,      
"99.99%" }
GC>              ,{ "IrrDb_GuaranteedZero"       , "IRR on\nDeath Bft"  ,      
"99.99%" }
GC>              ,{ ""                           , " "                  ,       
    "-" }

 We don't need the exact maximum value, but we do need to be able to
compute the maximal length of the strings in this column. I.e. we probably
should use "9999,99%" here if the values can be in thousands (but not tens
of thousands).

GC> @@ -2822,12 +2827,12 @@ class reg_d_individual_curr : public 
page_with_tabular_report
GC>              {{ "PolicyYear"              , "Policy\nYear"      ,         
"999" }
GC>              ,{ "AttainedAge"             , "End of\nYear Age"  ,         
"999" }
GC>              ,{ "GrossPmt"                , "Premium\nOutlay"   , 
"999,999,999" }
GC> -            ,{ "PremiumLoads"            , "Premium\nLoads"    ,     
"999,999" }
GC> -            ,{ "AdminCharges"            , "Admin\nCharges"    ,     
"999,999" }
GC> -            ,{ "COICharge_Current"       , "Mortality\nCharges",     
"999,999" }
GC> -            ,{ "SepAcctCharges_Current"  , "Asset\nCharges"    ,     
"999,999" }
GC> -            ,{ "GrossIntCredited_Current", "Investment\nIncome",     
"999,999" }
GC> -            ,{ "AcctVal_Current"         , "Account\nValue"    ,     
"999,999" }
GC> +            ,{ "PremiumLoads"            , "Premium\nLoads"    , 
"999,999,999" }
GC> +            ,{ "AdminCharges"            , "Admin\nCharges"    , 
"999,999,999" }
GC> +            ,{ "COICharge_Current"       , "Mortality\nCharges", 
"999,999,999" }
GC> +            ,{ "SepAcctCharges_Current"  , "Asset\nCharges"    , 
"999,999,999" }
GC> +            ,{ "GrossIntCredited_Current", "Investment\nIncome", 
"999,999,999" }
GC> +            ,{ "AcctVal_Current"         , "Account\nValue"    , 
"999,999,999" }
GC>              ,{ "CSVNet_Current"          , "Cash\nSurr Value"  , 
"999,999,999" }
GC>              ,{ "EOYDeathBft_Current"     , "Death\nBenefit"    , 
"999,999,999" }
GC>              };

 Again, if this is the right thing to do, then it needs to be done -- but
do the columns still fit on the page after this change?


 Please let me know if I should do anything else here or if I should leave
the further column width tweaking to you (as I'd be tempted to do, due to
lack of domain knowledge already mentioned above).

 Thanks,
VZ


reply via email to

[Prev in Thread] Current Thread [Next in Thread]