Link to home
Start Free TrialLog in
Avatar of paulo_psa
paulo_psaFlag for Brazil

asked on

Call NewPage when field value changes QuickReport

Hi,

How can I go to another page using QuickReport when one field value changes.
eg.

f1     f2     f3
aaa  bbb  ccc
aaa  bbb  ccc
aaa  bbb  ccc
-----------------
When f3 changes(from ccc to ddd),
it's printed in another page.

f1     f2     f3
aaa  bbb  ddd
aaa  bbb  ddd
aaa  bbb  ddd

Hope to be clear

thanks
Paulo
Avatar of PeterLarsen
PeterLarsen

Yo Paulo,

Something like this ??!!

/Peter


unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
    FText : TStringList;
    procedure SetText(Index : integer; Text : string);
  public
    { Public declarations }
    property Text[index : integer] : string write SetText;
  published
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

{ TForm1 }


procedure TForm1.SetText(Index: integer; Text: string);
begin
 While FText.Count-1 < Index do
  FText.Add('');
 //
 FText[Index]:=Text;
 //
 //check here to see whether you should change page or not !!!
 //
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
 FText:=TSTringList.Create;
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
 FText.Free;
end;

end.
ASKER CERTIFIED SOLUTION
Avatar of Jacco
Jacco
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of paulo_psa

ASKER

That's what I need.

thanks