Solved

Call NewPage when field value changes QuickReport

Posted on 2001-08-26
3
561 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
Comment Utility
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
Comment Utility
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
Comment Utility
That's what I need.

thanks
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

763 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

13 Experts available now in Live!

Get 1:1 Help Now