Issue 78128

Summary: RPT: cannot group by constant value
Product: Base Reporter: Frank Schönheit <frank.schoenheit>
Component: codeAssignee: marc.neumann
Status: CLOSED FIXED QA Contact: issues@dba <issues>
Severity: Trivial    
Priority: P3 CC: issues
Version: recent-trunkKeywords: new_implementation
Target Milestone: OOo 2.3   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
document to reproduce the bug case none

Description Frank Schönheit 2007-06-06 06:41:43 UTC
This is a follow-up of issue 78098. Therein, it was requested that the report
header should be generated before the page header on the first page, since this
is what other applications do, and this is what allows to do tabular reports
including a report header.

The agreement within the iTeam was that tabular reports should not be done by
placing the table header controls in the page header, but in the header of a
artificial group, which groups by a constant value.

Trying to do this reveals that it is currently not supported by the engine -
which boils down to: You cannot do reports which look like this:

page 1:
    +-------------------------------+
    |          Report Header        |
    +-----------+---------+---------+
    |  Field 1  | Field 2 | Field 3 |
    +-----------+---------+---------+
    | data      | data    | data    |
    | data      | data    | data    |
    | data      | data    | data    |
    | data      | data    | data    |
    | data      | data    | data    |
    | data      | data    | data    |
    | data      | data    | data    |
    | data      | data    | data    |
    +-----------+---------+---------+
page 2:
    +-----------+---------+---------+
    |  Field 1  | Field 2 | Field 3 |
    +-----------+---------+---------+
    | data      | data    | data    |
    | data      | data    | data    |
    | data      | data    | data    |
    | data      | data    | data    |
    | data      | data    | data    |
    | data      | data    | data    |
    | data      | data    | data    |
    | data      | data    | data    |
    +-----------+---------+---------+

The rows "|  Field 1  | Field 2 | Field 3 |" could either be page headers -
which doesn't work because of issue 78098 - or headers of a constant group -
which doesn't work because of this issue here.

To reproduce:
- open the attached database document
- open the report "countries, tabular" for editing
- note that the report contains one group, which is set up to group by
  a constant value "1"
- execute the report (enter "Europe" when asked for a parameter)
=> you'll get an error message saying that the report could not be executed.
   The "More" button in this message box gives you an error saying
java stack trace:
com.sun.star.lang.IllegalArgumentException
	at
com.sun.star.report.pentaho.SOReportJobFactory$_SOReportJobFactory.execute(SOReportJobFactory.java:197)
Comment 1 Frank Schönheit 2007-06-06 06:47:25 UTC
Created attachment 45683 [details]
document to reproduce the bug case
Comment 2 Frank Schönheit 2007-06-06 06:48:37 UTC
More findings:

Trying to order by a constant string (instead of a constant value), i.e. by '1'
instead of 1, gives an error message from the database engine, if you use
HSQLDB. Seems HSQL doesn't support ordering by constant string values as well ..
Comment 3 Frank Schönheit 2007-06-06 13:09:32 UTC
The Report Designer iTeam decided that this issue is a "should fix" for the
first release of the report designer. Targeting to 2.x, thus.
Comment 4 Frank Schönheit 2007-06-06 13:10:49 UTC
This is a new implementation in CWS oj14. Adding keyword "new_implementation".
Comment 5 Frank Schönheit 2007-06-06 13:15:48 UTC
oops - resetting target
Comment 6 ocke.janssen 2007-07-17 07:20:54 UTC
When changing the example in that way that the group has "Repeat Section"
enabled. The group header will not be repeated on a second page.
Comment 7 tmorgner 2007-07-26 13:37:49 UTC
The missing/invalid repeating headers have been fixed. Now the system reliably
generates pagebreaks before and after a repeating header gets active or inactive. 

Those manual pagebreaks are the only way to activate a new master-page,
therefore a repeated header or footer always implies a pagebreak before the
header and after the footer. There is nothing we can do about it - except
someone volunteers for changing both the fileformat specification and the writer
implementation. :)
Comment 8 Frank Schönheit 2007-07-29 20:46:40 UTC
In this case, we should have an issue for the misbehaviour (it *is* a
misbehaviour since it's not expectation conformant). See issue 80155.
Comment 9 ocke.janssen 2007-08-01 08:10:07 UTC
Please verify. Thanks.

You have to change the property "Repeat Section" for the group header and you
have to change the height of the section to get page breaks.
Comment 10 Frank Schönheit 2007-08-01 08:40:42 UTC
targeting to 2.3, since the fix is part of a CWS aiming for this release
Comment 11 marc.neumann 2007-08-02 11:36:20 UTC
verified in CWS rpt23fix02

find more information about this CWS, like when it is available in the master
builds, in EIS, the Environment Information System:
http://eis.services.openoffice.org/EIS2/cws.ShowCWS?Path=SRC680%2Frpt23fix02
Comment 12 drewjensen.inbox 2007-08-20 13:26:17 UTC
Tested w/ 2.3m_1 SRB 1.0

OK - the group header repeats, with the page break after the report header.

closing