How to get a fixed number of rows in master band of grouped repoprt?
I have a simple grouped report where each group in the dataset can have between 1 and 8 rows of data.
However, I need to always have 8 rows shown in the master band for each group, even if some of them are empty.
How can I always have 8 rows in each group, some with data and some with justy empty boxes?
This is a similar problem to the many 'invoice' type questions on this forum.
I have tried adapting the test8.fr3 provided by gpi in reply to ' Simple Invoice, Need help with fixed height detail band' but that (and answers to other fixed rows problems) assume the master band shows the entire dataset.
As soon as I use a group band I get data from more than one group in the master band and the layout is wrong.
Attached is my report file, based on gpi's sample. (It also shows where I need to have a the group footer showing the average of one of the fields in the group, but averaged out of 10, not 8)
However, I need to always have 8 rows shown in the master band for each group, even if some of them are empty.
How can I always have 8 rows in each group, some with data and some with justy empty boxes?
This is a similar problem to the many 'invoice' type questions on this forum.
I have tried adapting the test8.fr3 provided by gpi in reply to ' Simple Invoice, Need help with fixed height detail band' but that (and answers to other fixed rows problems) assume the master band shows the entire dataset.
As soon as I use a group band I get data from more than one group in the master band and the layout is wrong.
Attached is my report file, based on gpi's sample. (It also shows where I need to have a the group footer showing the average of one of the fields in the group, but averaged out of 10, not 8)
Comments
use the line variable to find out how many lines you have and show the band using the engine.showband method
the number of times required
For the benefit of others (or for me if I forget how to do this!)
The final report is this...
Now those groups with less than 8 rows - and hence those showing some child bands - no longer show the sum. No error, just nothing shown
Code I used was
in the final pass do the childband and sub the array value.
just like doing the total in group header demo only do it in the footer
The memo contained
[SUM(<frxDBDataset1."EstimatedPoints">,MasterData1)]
The only bands at the moment are a group header, grouping on another field in the dataset, MasterData1 and a group footer.
The above memo was in the group footer.
Using your code to give me the illusion of 8 master bands by using empty child bands to make up the difference, the sum function shows the correct value if there are 8 master data rows but shows nothing at all if any of the 8 'rows' are made up from child bands
[SUM(<frxDBDataset1."EstimatedPoints">,MasterData1,1)]
another method assuming you start a new page for each person
would be to use the overlay band draw your lines vertical and horizontal on it.
then you only need to force the footer down to where you want it by setting the engine.cury in the obp of the footer
No, still the same result, blanks when there are child bands.
It doesn't matter though, the method I an using by calculating it myself in the obp / oap works fine. I was just intrigued as to why the SUM() didn't work
I can't use the overlay band as there will be many of these little 8 row tables on each page - maybe even two columns of then.
Thanks for your help gordk, don't worry about it. I'll use the code that works.
Regards
The solution was not to use the OnBeforePrint event to draw the child bands inside a loop but instead use the OnAfterCalcHeight event.
That showed the blank rows in the group as it should do but also allowed the SUM() function in the group footer to operate correctly.
(is this a bug in the obp event I wonder?)