openfoodfoundation / openfoodnetwork

Connect suppliers, distributors and consumers to trade local produce.
https://www.openfoodnetwork.org
GNU Affero General Public License v3.0
1.1k stars 714 forks source link

[Reports] Bad PDF rendering on Revenues By Hub report #10256

Open filipefurtad0 opened 1 year ago

filipefurtad0 commented 1 year ago

Description

PDFs from a Revenues By Hub reports are not fitting the page width, leaving some info out of the page range.

Expected Behavior

Generated PDFs should fit the page width (Revenues By Hub).

Actual Behaviour

Generated PDFs from Revenues By Hub do not fit the page width.

Steps to Reproduce

  1. Log in as superadmin
  2. Visit Revenues By Hub
  3. Generate a report with some results, on screen.
  4. Now generate the respective PDF. Notice some data falls outside the page width.

Animated Gif/Screenshot

image

Workaround

Use the "Print Report" button instead.

Severity

bug-s3: a feature is broken but there is a workaround

Your Environment

Possible Fix

abdellani commented 1 year ago

Hi @filipefurtad0

In some reports, we have too many columns and I don't know if they can fit on a standard A4 paper.

The Order Cycle Customer Totals report is a good example:

image

In this case, do we use a bigger size page (A3 for example)? or do we split every row into two (or more) rows? or we can split the columns by pages? (page 1 will contain the first 8 columns, page 2 the next 8 columns etc...)

RachL commented 1 year ago

Jut a quick comment: if this is just affecting the revenues by hub report, we can lower the severity. It's just affecting super admins and they know how to work around it (if they ever user the PDF version which I doubt).

filipefurtad0 commented 1 year ago

That's a nice catch @abdellani ,

I was unaware of that issue on that report as well.

Indeed if we print Order Cycle Customer Totals report with the dropdown option, we do not get all the columns of the report:

image

If we use the print button, the output is scaled to the page width and includes all columns (although it does not use the full width of the page), and of course requires a very small font size to squeeze everything in:

image

So I would say the bug would be the "bad scaling" of the PDFs created via dropdown selector. It potentially affects all reports. I guess the expected behavior could be one of the solutions @abdellani points out:

In this case, do we use a bigger size page (A3 for example)? or do we split every row into two (or more) rows? or we can split the columns by pages? (page 1 will contain the first 8 columns, page 2 the next 8 columns etc...)

I would say it's a bug because it compromises reading and using the report, but perhaps we can also see it as a feature request - or even close the issue, if this is something which we don't consider a priority. What do you think @RachL ?

RachL commented 1 year ago

No one reported this, so there are high chances it's not used. I would lower to s4. Can this be a good first issue?