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