Home
Analytics
Including Group info in Page Header
dan3874
I have a report that has a table and in that table are two groups. When I run the report I get the header information and group information on page one. However, if the detail information runs over to the second page only the header information displays. The groups do not repeat. I would like the groups to repeat on page two if the detail information continues.
Find more posts tagged with
Comments
mwilliams
Hi Dan,
If you added a group to your report, there would be a group header that by default would repeat on page break. Did you add grouping to your table? Or is your data just grouped within the query?
dan3874
I guess you've got to be smarter than the equipment (or software) that you use! I had copied a report where I chose the patient and had nothing on the detail line cause it worked fine. After copying the report, I made it select by department and pull in the patient. I left the patient specific stuff in the group header area rather than moving it to the detail line. Once moved to the detail line everything worked well.
I do, however, have another question. How do I count the pages in the group? I may have one page for some patients and 2-3 pages for other patients. In the patient footer (group 2) I'd like to print "Page 1 of 2" based on the patient, not the whole report. How do I do that?
mwilliams
Take a look at this report from the devShare. It's one way to get it done.
http://www.birt-exchange.org/org/devshare/designing-birt-reports/491-page-numbers-in-report-layout-/
dan3874
As I tried to follow your instructions I am hitting a snag with the code inside the computed field.
I have this code in there taken from your report and modifying it to replace "COUNTRY" with "PATIENT_ID". The error I am getting says that "last" is not defined.
if (last == "0"){
last = row["PATIENT_ID"];
groupCount;}
else if (last == row["PATIENT_ID"]){
groupCount++;
groupCount;}
else {
last = row["PATIENT_ID"];
groupCount = 1;
groupCount;}
Could it be because your report only has one line per record and mine has many?
mwilliams
Did you define the variable "last"? You can see all the scripting done by looking at the script section of the outline. The page numbers per group idea I used is based on using an interval group. Your row heights will have to be uniform to make this approach work. They can be multiple lines, but they have to all be the same to be able to set an interval that you know will fit on a single page. Let me know.
dan3874
I don't think this method will work for me then. After the department I have the group for the patient (that I want to include the page of pages information on each one). The group header for patient has 3 rows - all the same height. Then I have one detail row. But, that detail row contains a sub-report table for medications, a sub-report table for radiology results and a cross-tab for lab results. I have no idea how to tell the script about all of those.
I guess for now, I'll just quit trying to have the pages per patient work. I do wish that BIRT could simply understand that when I place a page token on the group header or footer, that it would count those pages until that group is finished. But, obviously it is much more difficult than that.
Thanks for your help, though!
mwilliams
I've put in a request for a group page number feature for future versions directly with the development team. You can send one in through the enhancement request deal at the following url.
http://www.birt-exchange.org/org/resources/bug-reporting/
. You might be able to display a page count per page in a group, but it wouldn't be "n of m", it'd be just "n". This depends on how your page breaks are forced whether onPageBreak is called to be able to increment a variable.