feat: add PPTESTCD glossary slide to PowerPoint export#1326
Conversation
Insert a glossary slide after the title slide listing all PPTESTCD/PPTEST pairs used in the presentation. Splits across multiple slides when the table exceeds 20 rows. Closes #1325 Co-authored-by: Ona <no-reply@ona.com>
Use translate_terms() for PPTESTCD→PPTEST lookup so custom codes (e.g. user-defined ratio PPTESTCDs) appear in the glossary with their code as the label. Non-parameter column names (Statistic, USUBJID) are filtered out since they have no metadata match and translate_terms returns them unchanged. Co-authored-by: Ona <no-reply@ona.com>
…add_pptx_glossary_slides - as.character() coerces NULL to character(0) when no slide data exists - .add_pptx_glossary_slides returns list(pptx, n_slides) so the caller does not recompute the slide count independently Co-authored-by: Ona <no-reply@ona.com>
h5hoang
left a comment
There was a problem hiding this comment.
glossary shows up as intended on slide 2 and properly lists only the PPTESTCDs that appear in the rest of the deck, but overflows out of bounds of the slide layout with more params :
as you noted in the reviewer notes, changing the max_rows from 20 to ~8 to should fit within the slide bounds and I think it might be worth considering moving the table up to fill up the whitespace between "Glossary" and the table. But I think it looks good so far ! :)
… overflow - Use explicit ph_location coordinates in add_pptx_sl_table to position title compactly at top (top=0.15) and table right below (top=0.85) - Reduce glossary max_rows from 20 to 15 to fit within slide bounds Co-authored-by: Ona <no-reply@ona.com>
… prevent overflow" This reverts commit 7936fac. Co-authored-by: Ona <no-reply@ona.com>
- Position glossary table at top=1.2 (was 2.02) to close gap with title - Reduce glossary max_rows from 20 to 15 to prevent overflow - Reduce font size by 2pt (11 -> 9) in all PowerPoint flextables Co-authored-by: Ona <no-reply@ona.com>
Co-authored-by: Ona <no-reply@ona.com>
Co-authored-by: Ona <no-reply@ona.com>
Co-authored-by: Ona <no-reply@ona.com>
Co-authored-by: Ona <no-reply@ona.com>
Thanks for the feedback, I implemented the changes :) |
Verify slide creation and default footer for the table/plot slide functions after the fontsize change to 9pt. Co-authored-by: Ona <no-reply@ona.com>
|
@KOBANAK or @daviesmeg Could you have a review please? :) |
KOBANAK
left a comment
There was a problem hiding this comment.
I confirm it works as expected.


Issue
Closes #1325
Description
Adds a glossary slide as the second slide in the PowerPoint export (after the title slide, before content). The glossary is a two-column table (PPTESTCD | PPTEST) listing all PK parameter codes used in the presentation, looked up from
metadata_nca_parameters.Changes
.collect_pptestcds()— collects all unique PPTESTCDs from statistics tables (column names), individual parameter tables (column names), and boxplot names across all dose groups..build_glossary()— filtersmetadata_nca_parametersto matching codes and returns a sorted, deduplicated two-column data frame..add_pptx_glossary_slides()— renders the glossary as a flextable on "Title Only" layout slides, splitting across multiple slides when exceeding 20 rows.create_pptx_dose_slides()— integrates the glossary after the title slide and adjusts slide index offsets so summary slide reordering remains correct.Definition of Done
metadata_nca_parametersHow to test
.pptx— slide 2 should be a "Glossary" tableContributor checklist
.scsschange was done, rundata-raw/compile_css.Rdata-raw/test_suggests_hidden.RNotes to reviewer
metadata_nca_parameters. Non-standard codes (e.g., column names like "Statistic", "USUBJID") that appear in table headers are silently excluded since they have no match in the metadata.max_rowsparameter (default 20) controls pagination. Adjustable if the template layout fits more or fewer rows.create_pptx_dose_slideswas updated:lst_group_slidestarts at1 + n_glossary_slidesand summary slides move tofirst_content_pos(=2 + n_glossary_slides) instead of hardcoded2."