Several problems and suggestions about HTML report display in GnuCash

Dancefire dancefire at gmail.com
Thu Apr 22 10:57:21 EDT 2010


Hi,

I have 5 issues and 2 suggestions. To make me easy, I put them in a single mail.

Issue 1) All CJK characters are not shown correctly in HTML report display page.
I found the reason is encoding. Because all report are written in
UTF-8, (or current locale). The encoding should be included by the
generated HTML header. If I export the report, and use external
browser to look at it, I have to manually select encoding to make it
display correctly.

I got same problem in 2.3.11, which might using GtkHtml, I think the
stable version 2.2.9 should have same problem.

There are 2 ways to fix the problem.

1. When display a report using WebKit/GtkHtml, send current encoding
as parameters in the loading function.
2. During the html report generation, add following line in <head>...</head>

		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

using correct charset to replace "UTF-8".

Issue 2) Not all characters in HTML are correctly encoded.

I have a transaction, which description is "J&J BABY WIPE TRAVEL PACK
20S". and in the html report, it is

<td>J&J BABY WIPE TRAVEL PACK 20S</td>

'&' should be encoded as '&amp;'

Issue 3) Generated HTML file is not conform to HTML standard.
You can validate the generated file by http://validator.w3.org/ . It
will show several comformation problem.

Issue 4) Hardcode HTML in generation script.

I don't think it is a good way to do that. It will strongly limited
the way of customize report. There should be a templates, which can be
edit by html designer. The software replace several labels in the
template to generated report. All style should be controlled by CSS.
And no Inline Style should be used. It's better use linked style, and
copy the choosen CSS file to the same location of the report.

Or, you can generate report in XML format, and use different XLST to
generate different style of report.

All above methods try to seperate generation and the HTML template,
and seperate data and representation.

Issue 5) bug in the generation.
During I validate my transactions report, I found "</btd>" in my file,
which should be "</b></td>", such as

<td align="right" rowspan=1 colspan=1><b>AUD 254.70</btd>


Besides, I have 2 more suggestions.


1) Remember last location of File Open/Save dialog.

I have to find my report folder every time. I don't know it's Windows
version only or not.
However, it should be remembered by Gnucash. Since files might store
in diffferent location by it's type.
For example, QIF is in download folder; GnuCash XML data may be in
home folder; and Reports may be
at a shared folder. If gtk+ cannot remember them differently, I think
GnuCash should help user to
remember them.

2) Automatically append the extension, such as (.html), if user forgot
append them.
It's annoy to add the extension later if the extension is forgoten.
File may looks missing, when folder is
organized by sort by file type. I think it's not diffcult to do that.


--
Tao Wang
Microsoft Certified Technology Specialist
CCNA


More information about the gnucash-devel mailing list