Adjusting footer height based on record count

edited 9:08AM in FastReport 4.0
I want to adjust the height of the footer band based on the # of records in the details band. I have looked at the manuals and examples and can't seem to get this to work. The code below gives me the error - ')' expected - .


procedure FooterDetails1OnBeforePrint(Sender: TfrxComponent);
begin
footerDetails1.height:= (266-([COUNT(DetailData1)]*.5)*(35.5));
end;

Any suggestions would be appreiciated. Thanks

Glen

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 9:08AM
    it is because the expression you are using is invalid it is telling you at what position it expects to see the ).
    and the use of [] is also invalid, and the aggregate is not available until the footer is handled.
    one also must take great care when altering design heights of bands. you can actually widow a band's object(s) to the page,
    if the bands height is set to less than the top property of the object, and after you alter it you should reset it in the oap event or in successive iterations of the band the changes can become cumulative.
    What is it that you really want to accomplish? do you want the footer to print(output lower down?
    tip: look at making use of the line or line# variable
  • edited 9:08AM
    Thanks for your quick response, I am attempting to format a cheque that has three parts. The top is the cheque, the other two areas hold the same information.. a summary of each job the person is been paid for. I need to adjust the height of the footer on the first summary, so that the second summary starts to print in the bottom section. I have estimated that a person can have no more that 15 rows, in order for the summary to fit in both spaces. I will take a look at the use of the line# variable.

    Glen
  • gordkgordk St.Catherines On. Canada.
    edited 9:08AM
    Glen
    this is your key
    " I am attempting to format a cheque that has three parts"
    re think your design
    i assume you are using preprinted micr bank cheque forms.
    you do not want to use bands you want to use one design page with text objects in set positions.
    you want to control the data contents of those text objects.
    to help you design scan a blank form and use it as the page background image,
    you can also set it's visible and printable props.
    you can now place the objects in the area(s) you need them.
    you conect the tfrxreport component to a dataset to control the number of times to print.
    you write code in the obp event of the various objects to control the text in each line of it's memo.
    and iterate through a specific dataset that is available to the report(not the one used to control the report component).
  • edited 9:08AM

    Thanks for the suggestions, I will look at redoing the cheques the way you have suggested, thanks again

    Glen

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.