Value page header value depending of .......
In my report I have a page header and a master data band.
The report shows all products (in the master data band). In the page header there is a label in which the productgroup name of the products of that page are.
For example:
page 1 has the next master data values
So the value of the label of the page header of page 1 has to be: "productgroup a/productgroup b/productgroup c".
an another example:
page 2 has the next master data values
So the value of the label of the page header of page 2 has to be: "productgroup d".
So I have tried to do some checks in the OBP of the master data band. But according to me I can't good change the value of the label in the page header.
Does anybody know how I should do this?
The report shows all products (in the master data band). In the page header there is a label in which the productgroup name of the products of that page are.
For example:
page 1 has the next master data values
product1 Â Â Â Â productgroup a
product2 Â Â Â Â productgroup a
product3 Â Â Â Â productgroup a
product4 Â Â Â Â productgroup b
product5 Â Â Â Â productgroup b
product6 Â Â Â Â productgroup c
product7 Â Â Â Â productgroup c
product8 Â Â Â Â productgroup c
product9 Â Â Â Â productgroup c
So the value of the label of the page header of page 1 has to be: "productgroup a/productgroup b/productgroup c".
an another example:
page 2 has the next master data values
product10 Â Â Â productgroup d
product11 Â Â Â productgroup d
product12 Â Â Â productgroup d
product13 Â Â Â productgroup d
product14 Â Â Â productgroup d
product15 Â Â Â productgroup d
product16 Â Â Â productgroup d
product17 Â Â Â productgroup d
product18 Â Â Â productgroup d
So the value of the label of the page header of page 2 has to be: "productgroup d".
So I have tried to do some checks in the OBP of the master data band. But according to me I can't good change the value of the label in the page header.
Does anybody know how I should do this?
Comments
here is some ideas
report must be 2 pass on first pass gather values from mdband, pass out values to delphi to a record arrayor a tstringlist indexed by page number, using a custom userfunction,
you can pass up to 3 params out, code in obp mdband
if not finalpass then
avarname:=ufname(val1,val2,val3);
write on userfunction event handler for report component in delhi to handle what you pass out
in code of script of memo write code to assign values from external stringlist to
the memo using, if finalpass then, what ever you want to do,
but be careful if due to contents the memo causes the band to strech you will end up with bad info due page shifting in final pass.
regards
I have implemented the idea and it works perfect!
Thnx!!
There is a problem exactly what you say in your reply.
At the end of the page the master data band gets a new record, then he sees that the record does not fit on the page, so it must be moved to the next page.
But the problem is that I use the page variable.
Is there some variable that I can see that the record is moved so that I can change the page variable (page + 1) ?
is it moving because we stretched the page header in the final pass, or because of code checking freespace and forcing newpage?
If it always cuts at the same point say nth record of pageno x just add your own variable to track record count and 0 it in the pagehb and inc it in databand.
regards
But it is not so flexible, because when you change the height of the master data, you first must check how many records then fit on a page.
So is there no general solution for this problem?
On a page of a report there are 33 records. The 34th record is placed on the next page, etc.....
But the report generator knows that the 34th record is moved to the next page. So there should be some information that I could use that de pagenumber must incremented with 1??