This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Custom CSS for Reports

Tags: None
(comma "," separated)
markhm
Registered Member
Posts
85
Karma
0
OS

Custom CSS for Reports

Tue Feb 02, 2021 2:15 pm
I haven't found any documentation about how to create custom CSS for reports even though there is a setting to load a custom CSS for the report plug-in with v5.1.1 and a setting in the report option setting for prior versions.

I have experimented a little with a copy of the default CSS and have successfully changed report fonts to fonts available in linux and made report subtotals bold.

I see that the default CSS has comments that many report functions seem to have no effect.

Anyone familiar with all the working options available thru the CSS customization and where/when to apply them?
Ivan Perez
Registered Member
Posts
40
Karma
0

Re: Custom CSS for Reports

Fri Feb 05, 2021 1:04 am
I literally asked this question not too long ago:

https://mail.kde.org/pipermail/kmymoney ... 03721.html

I find the format and style really difficult to read. I'd like to be able to print the reports.

The two files that would have to be modified (which from your message I gather you have found, but others may have not) are:
Code: Select all
/usr/share/kmymoney/html/kmymoney.css
/usr/share/kmymoney/html/welcome.css

If you are running the application from the app image, you can extract the squashfs-root and find the css files there. I have checked that you can modify those and kmm will pick those changes up in the next run.

I have never contributed to KMM and just the idea of navigating the project seems daunting to me. The options to save the page and see the source code in reports and summaries are disabled. If someone could enable them, we could get those files in html, modify them, print them, and also use a browser to find out a style that would be better (for us) with a much shorter feedback loop.

EDIT: grammar
markhm
Registered Member
Posts
85
Karma
0
OS

Re: Custom CSS for Reports

Fri Feb 05, 2021 11:55 am
The css file controlling reports is the kmymoney.css file located in the kmymoney settings folder. In linux, which I am using, that is in the /.config/kmymoney/html folder.

I found that the file references windows fonts which don't exist in my distribution of linux. I changed those references to available linux fonts.
There are multiple instances of font references that I had to change. Sometimes, 3 fonts were referenced and sometimes 4 fonts were referenced. I am not sure why this varies or why there are several fonts named.
Changing the font references did give me better font rendering in my reports.

I was not getting my subtotals and totals appearing in Bold on my reports. I added the line:
font-weight: bold;
to the various totals sections in the file and that gave me the results I wanted.

To be safe, I saved a copy of the file in the folder where I keep my actual kmymoney files and pointed to it in the program's settings option. I did this because I had seen comments that users had problems in the past with a bad css file preventing kmymoney from running.

I have not ventured beyond these changes.
wrobelda
KDE Developer
Posts
33
Karma
1
OS

Re: Custom CSS for Reports

Wed Feb 10, 2021 5:22 am
markhm wrote:I found that the file references windows fonts which don't exist in my distribution of linux. I changed those references to available linux fonts.
There are multiple instances of font references that I had to change. Sometimes, 3 fonts were referenced and sometimes 4 fonts were referenced. I am not sure why this varies or why there are several fonts named.
(...)
I was not getting my subtotals and totals appearing in Bold on my reports. I added the line:
font-weight: bold;
to the various totals sections in the file and that gave me the results I wanted.


Can you please file w bug request for the windows fonts references? And while you're at it, feel free to also mention that subtotals could/should be in Bold, as well as any other suggestions/anomalies you noticed while you tinkered with it. Attached .css and before/after screenshots would be amazing.

We'll much appreciate and hope to improve them in next release.


KMyMoney developer. macOS/Debian/Windows


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]