Odd Report Output Format

John Ralls jralls at ceridwen.us
Sun Nov 18 07:16:41 EST 2012


On Nov 18, 2012, at 8:41 AM, David T. <sunfish62 at yahoo.com> wrote:

> I was just trying to generate a basic summary report listing totals for a subset of my accounts for the current YTD. I created a simple report that is set to display only the totals--in other words, on the Display option tab, every checkbox is cleared except "Totals", and the Amount widget reads "None."
> 
> The report looks fine in Gnucash--each account is displayed with its grand total amount only.
> 
> However, when I try to open the report in another program, I find that there are a slew of empty rows inserted into the output. Examining the raw exported data, I see that the output includes numerous empty HTML table rows ("<tr></tr>" and "<tr bgcolor="#ffffff"></tr>" for alternating bands in the table).
> 
> It appears that Gnucash is outputting a table row for each transaction in the dataset, even though I have explicitly suppressed the detail in the report. 
> 
> Does anyone know why this is happening, and what would need to change to fix it?

Just a guess, I'm not going to go through the code ATM, the author of the report didn't think of that use case and writes the <tr> tag, iterates through each possible item from the list, printing or suppressing each <td> according to the selections, and then writes the </tr> tag and repeats.

The fix would be to special-case the outer loop to suppress writing the <tr></tr> pair if none of the boxes are checked. Make sure that the total fields still accumulate the values!

Regards,
John Ralls




More information about the gnucash-user mailing list