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

Print view improvements #1747

Open
slifty opened this issue Feb 1, 2024 · 6 comments
Open

Print view improvements #1747

slifty opened this issue Feb 1, 2024 · 6 comments

Comments

@slifty
Copy link
Contributor

slifty commented Feb 1, 2024

Thank you for the awesome project!

I'm generating reports for my tax accountants and having an issue printing out my income statement and balance sheet from the fava interfaces. I think this used to work, so it's possible a recent release changed the print stylesheets.

Here's what the printed page looks like (notice how the bars stop at September and the expenses table is cut off early)

image

@slifty
Copy link
Contributor Author

slifty commented Feb 1, 2024

I should also mention that more generally there are a few things I'd love to see improved about the print view, for instance:

  1. removing the menu items from the bar chart (e.g. Stacked Bars / Single Bars / etc., as well as Net Profit / Income (Monthly) / etc)
  2. showing net profit after expenses
  3. Not showing the other column when there's nothing in it

@yagebu yagebu changed the title Print view cuts off Print view improvements Feb 4, 2024
@yagebu
Copy link
Member

yagebu commented Feb 4, 2024

I've played around with this a bit (in Firefox). It seems that this print preview happens to quickly or freezes the page in place before the chart can re-adjust for the printed page size - in general I also find it to be not very reproducible, the layout seems to be pretty random. It seems that not setting explicit sizes on the svgs but instead just setting a viewBox works better - with that, it always seemed to include the full chart without cutting it off - so that should be fixed by 76fcf59.

PRs with improvements to the print styles (like hiding unneeded things) are always welcome :)

@slifty
Copy link
Contributor Author

slifty commented Feb 4, 2024

Awesome and thanks so much for looking into it!

I'll take a look at improving print view further and open a PR asap (hopefully this doesn't mean Soon™, but rather, soon!)

slifty added a commit to slifty/fava that referenced this issue Feb 5, 2024
Most buttons are removed from the print view already, but some of the
chart UX was still there; this removes it, resulting in a cleaner print
view.

ISsue beancount#1747 Print view improvements
slifty added a commit to slifty/fava that referenced this issue Feb 5, 2024
Most buttons are removed from the print view already, but some of the
chart UX was still there; this removes it, resulting in a cleaner print
view.

Issue beancount#1747 Print view improvements
slifty added a commit to slifty/fava that referenced this issue Feb 5, 2024
Most buttons are removed from the print view already, but some of the
chart UX was still there; this removes it, resulting in a cleaner print
view.

Issue beancount#1747 Print view improvements
slifty added a commit to slifty/fava that referenced this issue Feb 15, 2024
Most buttons are removed from the print view already, but some of the
chart UX was still there; this removes it, resulting in a cleaner print
view.

Issue beancount#1747 Print view improvements
yagebu pushed a commit that referenced this issue Feb 18, 2024
Most buttons are removed from the print view already, but some of the
chart UX was still there; this removes it, resulting in a cleaner print
view.

Issue #1747 Print view improvements
@GuillaumeHM
Copy link

Hello,

I'm trying to do the same as you: printing reports for a tier. Which "printer" program do you use ?

I get blank pages or it works but with the right graph part missing. I tested :

  • weasyprint : blank page
  • wkhtmltopdf : blank page
  • firefox: right part missing
  • epiphany/webkit : right part missing

Portrait printing seems worse (wider part missing) than landscape.

The best would be weasyprint to work fine. Can any one explain why it doesn't ? The part missing is about a CSS property to adjust, I guess.

Thank you

@slifty
Copy link
Contributor Author

slifty commented Mar 3, 2024

@GuillaumeHM are you using the latest version of Fava? I know that there was a patch released recently to fix the right part in Firefox and I bet it might fix the others as well.

@GuillaumeHM
Copy link

Thank you. I upgraded from 1.26.2 yo 1.27.2 and here is the new status:

  • weasyprint : blank page
  • wkhtmltopdf : blank page
  • firefox: WORKING
  • epiphany/webkit : right part missing on landscape (plus datas missing on portrait, not sure if that is a regression)

To conclude, it is better on firefox ! But having at least one CLI tool working seems a minimum in order to enable scripting. For these, it seems some execution doesn't take place to set-up the page (typescript ?).

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

No branches or pull requests

3 participants