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
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

  • gordkgordk St.Catherines On. Canada.
    edited 4:41AM
    Hi tokie
    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

  • edited 4:41AM
    Gordk,

    I have implemented the idea and it works perfect!

    Thnx!!
  • edited 4:41AM
    Gordk,

    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) ?
  • gordkgordk St.Catherines On. Canada.
    edited 4:41AM
    Hi Tokkie
    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 ;)
  • edited 4:41AM
    GordK,

    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?
  • edited 4:41AM
    gordk wrote:
    is it moving because we stretched the page header in the final pass, or because of code checking freespace and forcing newpage?
    It is moving because of the many records.

    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??

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.