How to make group headers work?

hsmhsm
edited 4:13AM in FastReport 4.0
How can I get the group header text printed down the side of the master data (preferably rotated by 90 degrees as well)?
ie.
GroupHeader (GROUP BY Day Number)
----------------------------
  | master data about day 1
D | master data about day 1
A | master data about day 1
Y | master data about day 1
  | master data about day 1
1 | master data about day 1
  | master data about day 1
----------------------------
Group Footer 
----------------------------
  | master data about day 2
D | master data about day 2
A | master data about day 2
Y | master data about day 2
  | master data about day 2
2 | master data about day 2
  | master data about day 2
----------------------------
Group Footer
I've tried playing with vertical bands can cannot see how to make them work and searching for 'vertical band' in all the manuals produces almost no hits.

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 4:13AM
    place the vertical memo in the group header.
    in the obp event of the retreive the engine's cury and store in a variable
    in the oap event of the memo set the engine cury to the variables value
  • gpigpi
    edited 4:13AM
    See modified report template from FRDemo in attach
  • hsmhsm
    edited 4:13AM
    gordk wrote: »
    place the vertical memo in the group header.
    in the obp event of the retreive the engine's cury and store in a variable
    in the oap event of the memo set the engine cury to the variables value

    Sorry Gordk there seems to be some words missing in your reply and I cannot really understand what you mean.
    Which object's obp do I use to retrieve the engine's curY. Do you mean the memo in the group header?
    And how to I retrieve the engine's curY?
    I tried writing these two procedures in the obp and oap events of the memo in the group header but got an unidentified error message on frxreport1 (which is the correct name of the report)
    var CurrentY : integer;                                                     
    
    procedure frxDBDatasetFinalSefAreaText1OnBeforePrint(Sender: TfrxComponent);
    begin                                                                              
     CurrentY := frxreport1.engine.curY;                                                            
    end;
    
    procedure frxDBDatasetFinalSefAreaText1OnAfterPrint(Sender: TfrxComponent);
    begin
      frxreport1.engine.curY :=CurrentY;             
    end;
    
  • gpigpi
    edited 4:13AM
    Use subreport. See my previous Test.fr3
  • hsmhsm
    edited 4:13AM
    gpi wrote: »
    Use subreport. See my previous Test.fr3
    Thank you, I can see how your sub report works.
    However my data comes from a clientdataset (as the original database is SQLite) . This is linked to my report via a TfrxDBDataset so I don't think I can use ADOQueries on the data page as you do.

    In my cased I cannot really see how I can make the query for the subreport use the value of the grouping field in its where clause.
  • hsmhsm
    edited 4:13AM
    gordk wrote: »
    place the vertical memo in the group header.
    in the obp event of the retreive the engine's cury and store in a variable
    in the oap event of the memo set the engine cury to the variables value

    @ Gordk
    Ok I've managed to make the code work using just CurrentY := engine.curY; and engine.curY:=CurrentY;
    However the height of the memo in the group header seems fixed at whatever I design it as.
    Is there a way to make its height the same as the the space taken up by the master data band (which is not known beforehand)

    Maybe gpi's subreport is the way to go?
  • hsmhsm
    edited 4:13AM
    gpi wrote: »
    See modified report template from FRDemo in attach

    @gpi

    I've worked out how to translate your ADO queries into the ones I need for SQLite.
    I have then loaded in your template (complete with all the stretched/stretch mode values and wordwrap set to true as you had them) and simply changed the fields displayed to those from my data. However the vertical text still does not adjust to fit the sub report (see screenshot)

  • hsmhsm
    edited 4:13AM
    @gpi or @Gordk

    OK I've narrowed down the problem and it looks like it may be a bug in FR.
    I've put a memo in a master data band. On the right hand side of it there is a sub repport.
    I've set the stretch mode of the memo to smMaxHieght and set the data band's stretched to true.
    The memo's word wrap is set to true.

    That report works OK with the memo stretching to fit the size of the sub report (see screenshot 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.