| Summary: | [Improve Page Break Management] Create a total page number per group | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Lourens van Nieuwenhuizen <lvnieuwenhuizen> | ||||||||||||
| Component: | BIRT | Assignee: | Wei Yan <wyan> | ||||||||||||
| Status: | VERIFIED FIXED | QA Contact: | mindan xu <mindan.xu> | ||||||||||||
| Severity: | enhancement | ||||||||||||||
| Priority: | P3 | CC: | bluesoldier, mehmetfd, pinny, wenfeng.fwd, whe, wyan, xxue, yanke | ||||||||||||
| Version: | 2.2.0 | Keywords: | plan | ||||||||||||
| Target Milestone: | 2.5.0 RC1 | ||||||||||||||
| Hardware: | All | ||||||||||||||
| OS: | All | ||||||||||||||
| Whiteboard: | Autoed,G | ||||||||||||||
| Attachments: |
|
||||||||||||||
(In reply to comment #0) > Hi > We want to create a report with a "sub report", the sub report will be repeated > per a grouping in the main report and can span over 2 pages. > These sub reports needs to show their own pageNumber numbering and reset it per > group. The total pages per group will be variable. > Example: > Main report > Contract A > Data > page 1 of 4 > Data > page 2 of 4 > Data > page 3 of 4 > Data > page 4 of 4 > Contract B > Data > page 1 of 2 > Data > page 2 of 2 > Please contact me if you don't understand. > Lourens I have this same problem for a group report without subreport. Is there a way of showing the page numbers for a group report as described above? We are also very interested in this functionality. Let we know if we can partecipate in its definition/implementation. thanks, Federico defer to next major milestone. We need resolve most of the page-break/page-number/page-script issues together. This is something required by several of our reports as well - will this enhancement likely be included by the target milestone? i need this feature too. hope it can include in 2.5.0 M7 release. defer to RC1 due to resource limitation. Created attachment 135948 [details]
pv-group-total-page
an example to demonstrate the group page number, group total page number through page aggregation.
resolve through the new page scripting framework. see the attached example. fixed. Group name and group total page not work in web viewer. And group name is not consistant with the group detail in table content. see the screenshot Build <2.5.0.v20090522-0630> Created attachment 136790 [details]
screenshot
Created attachment 136794 [details]
generated pdf file
Created attachment 136963 [details]
new report design
the syntax to define the page aggregation has been changed, use the latest report design for testing. the attribute of page aggregation "workMode" is changed to "type". Verified. Hi I found that the page variable does not display on the first page of the document. I've even made the value 1 in onPageStart. Lourens can you attache a sample report design? Created attachment 138253 [details]
Test for page variable page number not on first page
Hi
Here is the example for the page number not showing on page 1 and 2.
Also note that there are 2 page breaks but the page number does not increment and displays 2 on the next status' first page which is on page 3 of the whole document, which means it did not register that there were 2 page breaks in between. But also points to the change made to set the page number to 1 and group name to first status onPageStart, causes the onPageEnd logic to fail.
Also note that the total page number is also incorrect. It's displays 1 of 1 then 2 of 2, rather than 1 of 2 and 2 of 2.
Other examples:
The resolved status data are over 2 pages but show 1 of 1 on both pages
Lourens
There are bugs in your scripts. Take the first page as example:
onPageStart
//the prevGroupKey and groupPageNumber are all NULL for first page.
var prevGroupKey = reportContext.getPageVariable("GROUP_NAME");
var groupPageNumber = reportContext.getPageVariable("GROUP_PAGE");
if (groupPageNumber == null)
{
groupPageNumber = 1;
}
if (prevGroupKey == null)
{
reportContext.setPageVariable("GROUP_NAME", groupKey);
}
reportContext.setPageVariable("GROUP_PAGE", groupPageNumber);
//After evaluation, the prevGroupKey is the first group while the group page number is 1.
onPageEnd:
//the prevGroupKey is the the current group
//the groupPageNumber is 1
var prevGroupKey = reportContext.getPageVariable("GROUP_NAME");
var groupPageNumber = reportContext.getPageVariable("GROUP_PAGE");
//as the prevGroupKey is the group key, so the groupPageNumber is set to 2.
if (prevGroupKey == groupKey)
{
if (groupPageNumber != null)
{
groupPageNumber = groupPageNumber.intValue() + 1;
}
else {
groupPageNumber = 1;
}
}
else {
groupPageNumber = 1;
}
//after evaluate, the groupPageNumber is 2. It is incorrect.
This is the same script in the previous design attached here 25-05-2009. Look at the attached - generated pdf file aswell to see that nothing happens on the first group pages and that it DONOT show 1 of 2 and 2 of 2 etc but 1 of 1 and 2 of 2. |
Hi We want to create a report with a "sub report", the sub report will be repeated per a grouping in the main report and can span over 2 pages. These sub reports needs to show their own pageNumber numbering and reset it per group. The total pages per group will be variable. Example: Main report Contract A Data page 1 of 4 Data page 2 of 4 Data page 3 of 4 Data page 4 of 4 Contract B Data page 1 of 2 Data page 2 of 2 Please contact me if you don't understand. Lourens