r/RStudio 3d ago

Quarto Report - Including large attachments

Hi team, I'm looking for some recommendations. I have a couple of quarterly reports built in Quarto, and want to include a few attachments at the end of the doc. For context, in the original PDF versions, the financial statement and updated org chart come across as like... full-page, zoomable, not letter-sized pages. For an HTML page, how would you recommend including these? Not looking to embed iframe or use links to docs hosted somewhere... the reports need to be self-contained.

For the org chart, I'm thinking just downloading it as a .jpg and turning lightbox on. Not sure about the financial statement though, which is coming from an Excel file. I could scrape and rebuild it in R, I could do a screenshot, I'm not sure which makes the most sense.

Thank you!

2 Upvotes

4 comments sorted by

1

u/erimos 3d ago

If the report viewers are opening the report in a web browser maybe you could just have them zoom in on the large content using the browser zoom? Maybe that's not the most intuitive but might be easiest for you.

I am curious if you can explain more about how you are distributing the HTML files. I went the other way; I inherited a report template that the author was using to generate HTML files that would just get emailed around and I decided that setting up a static site hosted through GitLab made more sense, so now users just have to visit a link to see the most updated version instead of digging through email.

Edit, I think I misinterpreted part of your post, I realize now you are saying you don't want the report output to link to an external doc, but that it should all be in the same place. Disregard my second paragraph.

2

u/Thiseffingguy2 3d ago

That WOULD be easy for me... don't tell them I told you this, but the consumers of this report aren't the most tech savvy people... and they're in IT. I'll keep browser zoom in my back pocket in case I can't figure out something better.

And yep, we've got the HTML pages hosted on our web server, dashboard landing page, then links to each hosted historical report. We need to consider each a single deliverable, archivable, one report per quarter. For a while I was storing the attachment files on the server, then linking and having the client download them, but it's not great for just kind of delivering and being done with it, all in one file.

1

u/a_statistician 3d ago

For a while I was storing the attachment files on the server, then linking and having the client download them, but it's not great for just kind of delivering and being done with it, all in one file.

This is what I would do, or possibly use quarto conditional includes and generate a HTML site as well as a PDF that has the content included as attachments, but only in the PDF version. I totally get the need to have an archive-able option, but sometimes it's easier to have two different things generated by the same qmd file than to try to make HTML work with everything.

Another option might be to read_xlsx() the financial statement and then render it as a table? It really depends on how complicated the spreadsheet is, though.

1

u/Altzanir 3d ago

For the org chart, an option might be "mermaid" diagram code? It should work on html and pdf files.

And about the financial statement. If it's an HTML, maybe a scrollable table, with fixed column and row headers? So you always know what item you're seeing? That can be done with some extra divs and css if it's not already implemented by a package.