Bug 100569 - REPORT BUILDER: Charts in Base do not support groups
Summary: REPORT BUILDER: Charts in Base do not support groups
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
5.1.3.2 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-23 18:03 UTC by branestawm
Modified: 2016-07-19 17:08 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Simple test file to show Line charts in Base do not support groups (15.63 KB, application/vnd.oasis.opendocument.database)
2016-06-23 18:03 UTC, branestawm
Details
Grouped charts while connecting chart to the group (15.70 KB, application/vnd.oasis.opendocument.database)
2016-07-17 14:38 UTC, Robert Großkopf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description branestawm 2016-06-23 18:03:36 UTC
Created attachment 125866 [details]
Simple test file to show Line charts in Base do not support groups

Line charts in Base do not support report groups - all the data points are shown in the chart for each group, in both Report Builder and in the report when executed.

The attached chartgrouptest.odb demonstrates this, using a simple HSQLDB embedded database. Query1 based on Table1 has 2 sorted Groups ("A" and "B"), each with 3 records with sorted "X-Values" and corresponding "Y-values". Query1 is arranged such that "X-values" are field 0, as seems to be required. In Report Builder, "Line charts report" is based on Query1 with a chart in the Group footer: the chart is shown with all data points (for all groups). On execution, the report is grouped correctly with detail data correctly shown, but all the data points appear in each chart.

In addition, the x-axis appears in date format unless "Source format" is deselected and integers selected, which I have done in the test file - presumably this is another bug.

I have found the same Group bug with XY charts.

Using LO v5.1.3.2 on OpenSuse 13.2 64-bit.
Comment 1 Alex Thurgood 2016-06-24 12:26:09 UTC
Confirming on

Version: 5.3.0.0.alpha0+
Build ID: 937877c8272db015948d196e539976182fc34937
Threads CPU : 2; Version de l'OS :Mac OS X 10.11.5; UI Render : par défaut; 
Locale : fr-FR (fr.UTF-8)

with test file provided.
Comment 2 Robert Großkopf 2016-07-17 14:38:43 UTC
Created attachment 126250 [details]
Grouped charts while connecting chart to the group

The charts in the first attachment aren't connected to the group. You have to open the "Data" of the chart and connect "Group" to "Group". Seems there is a problem to connect to the same query, so I created a second query the same way as the first query. Now the charts are grouped.

I couldn't confirm charts do not support groups. So I will set this bug to UNCONFIRMED.
Comment 3 Alex Thurgood 2016-07-18 11:35:54 UTC
Thanks Robert,

I only tested the OP's findings with his own file, but if you consider that the file is incorrectly set up, and have provided an example of how to do this correctly, let's set this report to WFM
Comment 4 branestawm 2016-07-18 18:22:22 UTC
Thanks for following this up, and your advice about linking group fields - I can't find this documented anywhere.

I can confirm that your modified test file with workaround works for me too.

However, when I connect the groups in my test file as you describe first, the report does not display any line charts (just blank spaces). I also have to copy/duplicate the underlying query, assign one copy to the basic report and the other copy to the line chart, as you have further described.

I am grateful for this workaround which also works with my full-scale mysql database table of 1700+ records and XY charts.

I don't see how this bug can be considered resolved if Report Builder cannot use the same query for text and chart for the same grouped data in the same report. Your workaround is ingenious but only covers up a ridiculous situation. 

What do you think - should I raise another bug report with slightly different wording?
Comment 5 Robert Großkopf 2016-07-19 06:41:27 UTC
(In reply to branestawm from comment #4)
> Thanks for following this up, and your advice about linking group fields - I
> can't find this documented anywhere.

I have documented this, because there hasn't been any documentation:
https://wiki.documentfoundation.org/images/e/e8/BH40-BaseHandbook.pdf

BaseHandbook in English is a translation of the German Base-Handbuch. The German version BH51 has 549 pages - much more content than the translated first version of the BH40.
> 
> However, when I connect the groups in my test file as you describe first,
> the report does not display any line charts (just blank spaces). 

The chart is a kind of subreport (like a form and a subform). Charts are the only way to connect to two different datasources in one report.
A chart without connecting to the report should show all the content of the datasource. A chart with connecting to the report should only show the content, which is filtered by the value of the group.
> 
> I don't see how this bug can be considered resolved if Report Builder cannot
> use the same query for text and chart for the same grouped data in the same
> report.
> 
> What do you think - should I raise another bug report with slightly
> different wording?

Take your database, which doesn't show any content in the chart. Open another bug report for this.
Comment 6 branestawm 2016-07-19 17:08:37 UTC
(In reply to robert from comment #5)

Thanks for the link to your very useful Base handbook, which I had found but I had mis-understood the bit about linking fields for grouping charts (because the relevant images are in German which I read imperfectly). Thanks for your explanation - and I'll take a look at the fuller German edition.

(BTW there seems to be a mis-statement in BH40 p29 on dBase databases: "All DBF files in this folder ... can be linked together using queries". Base queries in dBase databases operate only on a single DBF file/table - the Query design editor allows only one table. An SQL query which selects from more than one table produces an error message reporting "more than one table", and similarly if one tries to design a query selecting from several single-table queries. I think this important restriction is a feature of the Base driver and not a bug.)

> Take your database, which doesn't show any content in the chart. Open
> another bug report for this.

Will do.