Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Breaking on a custom field

edited December 2001 in General
I have a report I've been working on for a while and could really use some
help. I am trying to create a report which will create a group and subtotal
on the 42nd occurrence of a form. I can fit two forms on a page. I have a
page index with two images, a detail band, and a custom grouping on a
calculated field. I have placed the calculated field in my detail band.
Here is my calculation:

procedure FormNumberOnCalc(var Value: Variant);
var
x: Integer;
begin
x := x + 1;
Value := Trunc(x/41);
end;

I have placed the following in my OnGetBreakValue
BreakValue := IntToStr(FormNumber);

I am going about this in the wrong way? Any help is greatly appreciated.

Comments

  • edited December 2001
    The OnCalc is going to fire too late. The group checks the text of the
    variable. You'll need to code the variable's OnGetText event, and set the
    variable's type to String. I assume you have one record per form and and
    they are all static height, so that two fit pre page. You could do something
    like this:

    procedure TForm1.ppVariable1GetText(Sender: TObject; var Text: String);
    begin

    if ppReport1.Datapipeline.RecordNo >= 42 then
    Text := 'break'
    else
    Text := 'nobreak';

    end;



    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.