Column headers for child band

Hi

I am building my report in code (i.e. no data aware components). On the report designer are just simple 'TFrxChild' bands. I use the following code to add my "grid" of data with a header first, then the rows of data afterwards:

LChildHeader:=frxReport.FindObject('childHeader') as TFrxChild;
LChildRow:=frxReport.FindObject('childRow') as TFrxChild;

frxReport.Engine.ShowBand(LChildHeader);
for i:=0 to Count-1 do
frxReport.Engine.ShowBand(LChildRow);

This is all great until the data breaks onto a new page and needless to say I don't get the column headers repeated at the top of the new page.

Is there a way to do this programatically e.g. an event that fires (maybe called 'OnNewPage') when a new page is created so as I can add the column header again ? Or have I used the wrong componets to achieve this in the first place? I've seen the TFrxGroupHeader component but this seems to want a datasource etc. TFrxColumnHeaders didn;t seem to have the 'ReprintOnNewPage' property.

Hope someone can help
Thanks
Bill.

Comments

  • gpigpi
    edited 7:18PM
    Try to use TfrxPageHeader band
  • edited 7:18PM
    Hi

    Thanks for the reply. I've tried using a PageHeader and it doesn't achieve what I would like. The problem with it is that it will always reprint my "column headers" at the top of the page even if I am in a section of the report that doesn't need them.

    I was wondering if there is some way of connecting the bands so as a particular band will automatically get reprinted on a new page when the detail band spills over onto the next page ? Sometimes I have a bands that get printed on the report that are just free text notes, and of course I don't want the column header to get printed then when a new page is encountered.

    I've tried using the CrossView component, but I found another set of issues to do with resizing with this. I've tried using the ColumnHeader component, but this doesnt seem to get reprinted on the report when a new page is created.

    Is there any other approach to this ?

    Also I have just noticed I have posted this topic to the wrong forum. I am using Fr 4 not 3! Should I repost in the Fr 4 forum ?

    Thanks
    Bill
  • edited 7:18PM
    1. There is a similar case on FR 4 forum - someone described a FR3 problem over there.
    But after a few days (or even hours) that topic received status "moved".
    So it is possible but I do not know how to make it [img]style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> 2. Try to add a ChildBand to your PageHeaderBand. Put Column Headers on the ChildBand and according to your needs use FR script and events to make the ChildBand visible or not. Mick[/img]
  • FRNLFRNL Hoogeveen - Netherlands
    edited 7:18PM
    Hi

    Thanks for the reply. I've tried using a PageHeader and it doesn't achieve what I would like. The problem with it is that it will always reprint my "column headers" at the top of the page even if I am in a section of the report that doesn't need them.

    I was wondering if there is some way of connecting the bands so as a particular band will automatically get reprinted on a new page when the detail band spills over onto the next page ? Sometimes I have a bands that get printed on the report that are just free text notes, and of course I don't want the column header to get printed then when a new page is encountered.

    I've tried using the CrossView component, but I found another set of issues to do with resizing with this. I've tried using the ColumnHeader component, but this doesnt seem to get reprinted on the report when a new page is created.

    Is there any other approach to this ?

    Also I have just noticed I have posted this topic to the wrong forum. I am using Fr 4 not 3! Should I repost in the Fr 4 forum ?

    Thanks
    Bill


    In FR4, the Child band has a "child" property, I wonder if that keeps them together when your report exceeds the page.

    I still wonder why folks try to figure out these things themselves. I would say: put your data in a client dataset of a jvMemdata and print it from there. That gives you the full power of FastReport without having to invent part of the wheel yourself.

    Best regards,
    Teo
  • edited 7:18PM
    Hi

    I am building my report in code (i.e. no data aware components). On the report designer are just simple 'TFrxChild' bands. I use the following code to add my "grid" of data with a header first, then the rows of data afterwards:

    LChildHeader:=frxReport.FindObject('childHeader') as TFrxChild;
    LChildRow:=frxReport.FindObject('childRow') as TFrxChild;

    frxReport.Engine.ShowBand(LChildHeader);
    for i:=0 to Count-1 do
    frxReport.Engine.ShowBand(LChildRow);

    This is all great until the data breaks onto a new page and needless to say I don't get the column headers repeated at the top of the new page.

    Is there a way to do this programatically e.g. an event that fires (maybe called 'OnNewPage') when a new page is created so as I can add the column header again ? Or have I used the wrong componets to achieve this in the first place? I've seen the TFrxGroupHeader component but this seems to want a datasource etc. TFrxColumnHeaders didn;t seem to have the 'ReprintOnNewPage' property.

    Hope someone can help
    Thanks
    Bill.
    i tryed to do that by creating group header and group footer with master inside them but i could not obtain what i need.
  • edited 7:18PM
    This is my first time I visit here. I found so many interesting stuffs in your forum especially its discussion. From the tons of comments on your posts, I guess I am not the only one having all the enjoyment here! Keep up the good work.

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.