Fixed number of rows in a group

I need some help

I want group detail to print fix number of rows such as 15. If records in group are less than 15 then 15 rows must be printed but if there are more records than 15 then actual number of records should be printed.

Regards
Khawar

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 5:27AM
    I need some help

    I want group detail to print fix number of rows such as 15. If records in group are less than 15 then 15 rows must be printed but if there are more records than 15 then actual number of records should be printed.

    Regards
    Khawar
    More info please.
    What bands are you using groupbands of master detail?
    What version of fr4 are you using XE,basic standard pro?
  • I am using fastreport 4 Pro

    Bands are as under

    Group Header

    Master Data

    Group Footer

    I want fix number of rows in master data for each group

    Screen Shot is attached
  • gordkgordk St.Catherines On. Canada.
    edited September 2013
    unfortunately this can only be used in master detail type situation
    create an unattached child band dthe height of your masterdataband
    and duplicate the memos of the masterband in the child band with no data.
    in the onbeforeprint event of the footer write code to show the child if line is less than what you want.
    if <line> < 15 then engine.showband(childbandname);
  • First of all thanks for your helpful suggestion. You guided me to the right direction and I acheived the desired output. But now after doing it this way another strange problem is occurring which was not there before

    Problem is that no totals are being calculated in group footer band. I have attached report before and after the changes. You can see that all the totals are showing blank
    Report File is also attached



    The code I used is as below
    wrote:
    Var
    i:Integer;

    procedure MasterData1OnBeforePrint(Sender: TfrxComponent);
    begin
    i:=i+1;
    end;

    procedure GroupFooter1OnAfterPrint(Sender: TfrxComponent);
    begin
    i:=0;
    end;

    procedure GroupFooter1OnBeforePrint(Sender: TfrxComponent);
    begin
    for i:=i to 38 do
    begin
    engine.showband(Child1);
    i:=I+1;
    end;
    end;

    begin
    i:=0;
    end.




    Regards
    Khawar Naseer
  • I know i can do it using variables and getting the total in variable (like running total) but if you know any other solution
  • gordkgordk St.Catherines On. Canada.
    edited 5:27AM
    it seems like what you want is to just drive the footer down to the page bottom and not print empty rows.
    if this is correct.
    just write code inthe obp of the footer to set the engines cury.
    if engine.cury < predermined value then engine.cury= predeterminvalue.

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.