Solved

Call NewPage when field value changes QuickReport

Posted on 2001-08-26
3
571 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

733 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