Solved

Call NewPage when field value changes QuickReport

Posted on 2001-08-26
3
563 Views
Last Modified: 2013-11-22
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
0
Comment
Question by:paulo_psa
3 Comments
 
LVL 2

Expert Comment

by:PeterLarsen
ID: 6427843
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.
0
 
LVL 10

Accepted Solution

by:
Jacco earned 100 total points
ID: 6442141
Hi Paulo,

You could use a GroupBand

The components on the QuickReport are as follows:

GroupHeader
DetailBand

The GroupHeader is a TQRGroup

Set the QRGroup1.Expression to Query1.f3

Set QRGroup1.ForceNewPage to True

Regards Jacco
0
 

Author Comment

by:paulo_psa
ID: 6442869
That's what I need.

thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
indy tidtcpclient threading issue 8 63
code issue 8 100
Strange behavior when a form is closed 6 51
Dynamically Created Query 3 50
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now