Text Search Parameter Saving (part deaux)
I am attaching a sample piece of code.
The code sets ppReport1.TextSearchSettings.DefaultString to 'Apples'
The user changes the text to search for to 'Label'
When Close is clicked on the Preview,
ppReport1.TextSearchSettings.DefaultString is still 'Apples'
(same holds true for ppReport1.TextSearchSettings.WholeWord)
What I need to do is capture what the user has set so that it can be used
for the default in subesequent reports.
Thanks
Joe
The code sets ppReport1.TextSearchSettings.DefaultString to 'Apples'
The user changes the text to search for to 'Label'
When Close is clicked on the Preview,
ppReport1.TextSearchSettings.DefaultString is still 'Apples'
(same holds true for ppReport1.TextSearchSettings.WholeWord)
What I need to do is capture what the user has set so that it can be used
for the default in subesequent reports.
Thanks
Joe
This discussion has been closed.
Comments
unit sample;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ppPrnabl, ppClass, ppCtrls, ppBands, ppCache, ppComm, ppRelatv,
ppProd, ppReport, StdCtrls, ppParameter;
type
TForm1 = class(TForm)
ppReport1: TppReport;
ppHeaderBand1: TppHeaderBand;
ppDetailBand1: TppDetailBand;
ppFooterBand1: TppFooterBand;
ppLabel1: TppLabel;
ppLabel2: TppLabel;
ppLabel3: TppLabel;
ppLabel4: TppLabel;
ppLabel5: TppLabel;
ppLabel6: TppLabel;
ppLabel7: TppLabel;
Button1: TButton;
Label1: TLabel;
Label2: TLabel;
ppParameterList1: TppParameterList;
Label3: TLabel;
Label4: TLabel;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure ppReport1PreviewFormClose(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
ppReport1.Print;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
ppReport1.TextSearchSettings.DefaultString := 'APPLES';
Label1.Caption := 'Original: ' +
ppReport1.TextSearchSettings.DefaultString;
If True = ppReport1.TextSearchSettings.WholeWord then
Label3.Caption := 'Whole Word = True'
else
Label3.Caption := 'Whole Word = False'
end;
procedure TForm1.ppReport1PreviewFormClose(Sender: TObject);
begin
Label2.Caption := 'Change To: ' +
ppReport1.TextSearchSettings.DefaultString;
If True = ppReport1.TextSearchSettings.WholeWord then
Label4.Caption := 'Whole Word = True'
else
Label4.Caption := 'Whole Word = False'
end;
end.