Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Max Columns Per Page #127

Closed
dylanjohnlukes opened this issue Nov 15, 2022 · 6 comments
Closed

Max Columns Per Page #127

dylanjohnlukes opened this issue Nov 15, 2022 · 6 comments

Comments

@dylanjohnlukes
Copy link

Is there a way to program column spillovers? For example, I know there are parameters that allow users to specify the the maximum rows per page. Is there a similar setting for columns? I have a table with 25+ columns where I'd like half of these to spillover to the next page automatically while keeping the same table row inputs.

@elong0527
Copy link
Collaborator

Is it sufficient to create two or more tables separately by reducing your dataset?

RTF is a row based syntax. The user needs to determine which column needs to be in which page/file anyhow.

@dylanjohnlukes
Copy link
Author

I can manually partition the column names and create two separate tables, however, the goal is to create a table where X columns are on page 1 for a set of unique IDS and Y columns are on page 2 for the same set of unique IDS. This would then be repeated for new sets of unique IDS for an additional 20 pages making the manual process a bit burdensome.

@BrianLang
Copy link
Collaborator

What is the use case here and why would it be necessary to include all of the columns in the same table instead of across multiple tables? I'm having trouble imaging why one would want this. Some sort of a patient listing with 25 variables?

I agree that there is no nice way to do this in a rtf.

@dylanjohnlukes
Copy link
Author

Exactly, the use case I’m envisioning here is a patient listing with 25+ variables.

@BrianLang
Copy link
Collaborator

Seems like one could do a wrapper like:

Make subtables with a fixed number of rows per page (user input) and fixed number of columns per page (user-Input).
Insert, in order, the individual tables into the document.

@elong0527
Copy link
Collaborator

Agree, create a helper function is recommended to meet your specific need.

One challenge is to ensure the two/more pages with the same number of records contains the same number of rows.

You can control number of rows per page using nrow argument in rtf_page and cell_nrow argument in rtf_body.

After you define two tables, you can combine them by post-processing content in each page using verbose = TRUE in rtf_encode.

If you have flexibility to control layout, I would also suggest to use section title to reduce number of columns required for the listing. Here is one example for ICH listing.

https://www.pharmasug.org/proceedings/2021/EP/PharmaSUG-2021-EP-085.pdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants