torv72 / torv-reports-v4

1 stars 0 forks source link

Reports not including the specified date range for OM #62

Open torv72 opened 1 day ago

torv72 commented 1 day ago

Nevermind on most of this. I figured it out! This particular client had OM testing done in December of 2021. I set the om_season to "season" not realizing the December is not part of autumn which 99% of my clients do this test in Sept, Oct, and maybe November. Anyways, I changed it to "all" and it works. Not sure if there is a better way to define it other than to included December as part of the "season"????

Also, I changed the beeswarm to "No" and that showed up better. No worries there.

Still wondering about the PDF attachments when you get a chance.

Below was my original Issue:

Not sure if this is specific to a client or in general. I generated a report in both pdf and html for Bartlett Hill Golf Course. I will include the report function below. He has been doing OM testing since 2021. However, the vizualizations only show going back to 2022 on both the html and pdf versions. Also on the pdf version the heat map below the charts only goes back to 2022. I've triple checked the MASTERDATABASE and everything seems in order there. Is there a limit on the testing???

He mentioned in the visualization that he could only see "three" dots when there should be six in th 0-2cm chart. 2022 looks like there is 6. However, 2023 and 2024 only look like 3. The "tool tip" says 6 samples which is correct. Could it be the samples are so close in value that they look like they are on top of each other and thus looks like a single dot? I think that's what is going on. No worries at all on it, just wanted to get your opinion on it.

Final question is regarding attaching the lab results pdfs to the html version....I have perfect success in using [^pdf] syntax and attaching the lab results as a click and download. However, when I send it to my client and they try, they are getting an error message saying the pdf is not available. They are using Chrome. I'm using Chrome. Just wondering if there is sure fire way to embed the pdfs or not.

Here is the report function. I will send a MASTER DATABASE to you in email in case you want to take a closer look at it.

generate_report(.site_name = "Bartlett Hills Golf Course", .zip_code = 60301, .date_sample_submitted = "2024-10-21", .start_date = "2021-12-16", .om_seasons = "season", .om_stats = "average", .warm_or_cool = "cool", .acid_extract = "Mehlich", .include_results_interpretation = "No", .include_sand_fraction = "No", .draw_beeswarm = "No", .output = c("pdf","html"))

Here is the pdf report. I will send the html in an email.
TORV-report_Bartlett-Hills-Golf-Course_2024-10-21_season_average copy.pdf

z3tt commented 20 hours ago

cf. season definition:

We can adjust the definition of the seasons as we like, it might be also fine to have seasons of different lengths. Another solution could be to define two "testing periods" instead, if it's more helpful. Let me know if you want me to adjust the logic.

cf. linked PDF:

As you are pointing to a local file on your computer when linking to the PDF, it can't work on your client's computer. The file is located on your hard drive and is not hosted on the web. So the only solution is that the client stores the PDF (attached to your email) in the exact same place. I.e. if the path to the PDF is specified as /documents/reports/abc.pdf because that is the relative path that's working for you, the client would need to place the PDF in exactly the same location (and the HTML file in the same place as yours as well if it's relative paths; in case of absolute paths, e.g. paths that feature your name, it will never work as long as the client's account has not the exact same name). And if the client works on a different OS, we run into issues as well due to the various ways to specify paths...

Long story short: The current setup doesn't allow for it "out of the box" and you'd need to explain those technical details to your clients. Definitely not what you want I guess.

Potential Solutions:

For the latter, keep in mind that the PDF files might be exposed to the public. If you're using a cloud storage, you can control access rights. If you use GitHub, the repository needs to be public and consequently, all files can be found by anyone with an internet connection. Also, GitHub is not built to host binary files such as PDF so it's definitely not the best choice. Other providers (e.g. archive.org, jumpshare.com, titlegram.com) are more suited for that but the files might be publicly available as well. I am not an Adobe user but it seems they offer such services as well, and even allow you to protect those files (in case you have a Adobe subscription). You could also password-protect the PDF files themselves and send that password to your client.

torv72 commented 16 hours ago

Remind me how the current season definition is set up right now?

Bartlett Hills was an anomaly as the results of their lab report didn't come back until mid December of that year.

torv72 commented 16 hours ago

Thank you for the advice on the PDFs. I was getting excite about imbedding pdfs and such in the report and learning the tuft commands to do it. I'll check out your suggestions.

For what it is worth, the reports that I have generated so far and have sent have been very well received. Thank you!