[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 031070b 132/156: Implement supplemental repor
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 031070b 132/156: Implement supplemental report page for the regular illustrations |
Date: |
Tue, 30 Jan 2018 17:22:31 -0500 (EST) |
branch: master
commit 031070b4707607c6e96db2e85412567bddaf5fcb
Author: Vadim Zeitlin <address@hidden>
Commit: Vadim Zeitlin <address@hidden>
Implement supplemental report page for the regular illustrations
The columns vector is constructed dynamically using the supplemental
report columns defined in the ledger itself for this report.
---
ledger_pdf_generator_wx.cpp | 53 ++++++++++++++++++++++++++++++++++++++++++++
supplemental_report.mustache | 7 ++++++
2 files changed, 60 insertions(+)
diff --git a/ledger_pdf_generator_wx.cpp b/ledger_pdf_generator_wx.cpp
index b72ad06..0898470 100644
--- a/ledger_pdf_generator_wx.cpp
+++ b/ledger_pdf_generator_wx.cpp
@@ -763,6 +763,9 @@ class pdf_illustration : protected html_interpolator
virtual std::string get_lower_footer_template_name() const = 0;
protected:
+ // Explicitly retrieve the base class.
+ html_interpolator const& get_interpolator() const {return *this;}
+
// Helper for abbreviating a string to at most the given length (in bytes).
static std::string abbreviate_if_necessary(std::string s, size_t len)
{
@@ -1835,6 +1838,52 @@ class tabular_detail2_page : public
page_with_tabular_report
}
};
+class supplemental_report : public page_with_tabular_report
+{
+ public:
+ explicit supplemental_report(html_interpolator const& interpolate_html)
+ {
+ constexpr std::size_t max_columns = 12;
+ std::string const empty_column_name("[none]");
+
+ for(std::size_t i = 0; i < max_columns; ++i)
+ {
+ auto name =
interpolate_html.evaluate("SupplementalReportColumnsNames", i);
+ if(name != empty_column_name)
+ {
+ // We currently don't have the field width information for
+ // arbitrary fields, so use fixed width that should be
+ // sufficient for almost all of them.
+ columns_.emplace_back
+ (illustration_table_column
+ {std::move(name)
+
,interpolate_html.evaluate("SupplementalReportColumnsTitles", i)
+ ,"999,999"
+ }
+ );
+ }
+ }
+ }
+
+ private:
+ std::string get_fixed_page_contents() const override
+ {
+ return "{{>supplemental_report}}";
+ }
+
+ std::string get_upper_footer_template_name() const override
+ {
+ return "footer_disclaimer";
+ }
+
+ illustration_table_columns const& get_table_columns() const override
+ {
+ return columns_;
+ }
+
+ illustration_table_columns columns_;
+};
+
// Regular illustration.
class pdf_illustration_regular : public pdf_illustration
{
@@ -1973,6 +2022,10 @@ class pdf_illustration_regular : public pdf_illustration
}
add<tabular_detail_page>();
add<tabular_detail2_page>();
+ if(invar.SupplementalReport)
+ {
+ add<supplemental_report>(get_interpolator());
+ }
if(!invar.IsInforce)
{
add<numeric_summary_or_attachment_page<true>>();
diff --git a/supplemental_report.mustache b/supplemental_report.mustache
new file mode 100644
index 0000000..5743626
--- /dev/null
+++ b/supplemental_report.mustache
@@ -0,0 +1,7 @@
+{{>header}}
+
+<p align="center">{{SupplementalReportTitle}}</p>
+
+{{>dollar_units}}
+
+{{! The supplemental report table itself is generated from C++ code }}
- [lmi-commits] [lmi] master 6510601 150/156: Rename a mute variable to avoid gcc -Wshadow warning, (continued)
- [lmi-commits] [lmi] master 6510601 150/156: Rename a mute variable to avoid gcc -Wshadow warning, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 048ae05 093/156: Start NASD PDF illustration class implementation, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 5ea5c86 101/156: Simplify and correct current PDF DC font handling, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master ec490eb 153/156: Revise and extend some comments in PDF generation code, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 38cab5e 096/156: Make footer template depend on illustration kind, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master d1204c2 111/156: Factor out common parts of render_or_measure_fixed_page_part(), Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master e388f6e 037/156: Add beginning of numeric summary page using an external template, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 531699b 115/156: Factor out common page_with_basic_tabular_report class, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master a85943b 124/156: Add the rest of individual private placement illustration pages, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master f0b9cea 113/156: Add "Assumption Detail" page to NASD illustrations, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 031070b 132/156: Implement supplemental report page for the regular illustrations,
Greg Chicares <=
- [lmi-commits] [lmi] master 9fe1d07 125/156: Implement page-specific footer for "Tabular Details" pages, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 4f3a02e 078/156: Add company logo to the cover page, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 2d93248 118/156: Add the rest of group private placement illustration pages, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 1272ce2 127/156: Don't include "Assumptions" page in composite NASD illustrations, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master e00ab7d 080/156: Hide "attained age" column for composite illustrations, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 29e63d6 117/156: Add basic illustration page of group placement illustration, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 1a9bfb3 137/156: Factor out standard_supplemental_report class, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 7c0ff88 145/156: Add copyright notices to all .mst template files, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master 2fd6a11 147/156: Use shorter and more consistent names for external templates, Greg Chicares, 2018/01/30
- [lmi-commits] [lmi] master b09a25f 026/156: Implement numbering pages in the PDF output, Greg Chicares, 2018/01/30