beancount / fava

Fava - web interface for Beancount
https://beancount.github.io/fava/
MIT License
1.96k stars 286 forks source link

Print view improvements #1747

Open slifty opened 8 months ago

slifty commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

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 76fcf595.

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

slifty commented 8 months ago

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!)

GuillaumeHM commented 7 months ago

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 :

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 commented 7 months ago

@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 commented 7 months ago

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

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 ?).