Passing variables from delphi 7 pro
Hi
I have a report in which the end user can use an autosearh list to limit a
report to transactions after a certain date. To do this he picks > or >= to
a date.
When this occurs I have a procedure in a Delphi 7 program which then checks
the search operator and then puts the autosearch.value into a local variable
within my procedure. I then change the search criteria from > date to all
dates and I want to pass the original autosearch value back into the report
where I can use the variable to hide certain detail bands.
Here is the structure of my delphi unit that concerns what I am doing.
TDReports = class(TDBase)
rep: TppReport;
procedure repBeforePrint(Sender: TObject);
//---------------------------------------------------------------
procedure TDReports.repBeforePrint(Sender: TObject);
begin
inherited;
if rptFileName = 'CstStm.brp' then
DataByDate;
end;
//----------------------------------------------------------------
procedure TDReports.DataByDate;
var
GetDate : String;
begin
If rep.AutoSearchFields[0].SearchOperator = soGreaterThan or
rep.AutoSearchFields[0].SearchOperator = soGreaterThanOrEqualTo then
begin
GetDate := rep.AutoSearchFields[0].Value;
if (rep.AutoSearchFields[0].FieldName = 'IssueDate') then
rep.AutoSearchFields[0].SearchExpression := '';
end;
end;
//-----------------------------------------------------------------
How do I pass the string variable "GetDate" back into the report
"CstStm.brp" so I can use it in the BeforePrint event in the report itself
and how do I pick up this variable in the report?
Allan Ryan
I have a report in which the end user can use an autosearh list to limit a
report to transactions after a certain date. To do this he picks > or >= to
a date.
When this occurs I have a procedure in a Delphi 7 program which then checks
the search operator and then puts the autosearch.value into a local variable
within my procedure. I then change the search criteria from > date to all
dates and I want to pass the original autosearch value back into the report
where I can use the variable to hide certain detail bands.
Here is the structure of my delphi unit that concerns what I am doing.
TDReports = class(TDBase)
rep: TppReport;
procedure repBeforePrint(Sender: TObject);
//---------------------------------------------------------------
procedure TDReports.repBeforePrint(Sender: TObject);
begin
inherited;
if rptFileName = 'CstStm.brp' then
DataByDate;
end;
//----------------------------------------------------------------
procedure TDReports.DataByDate;
var
GetDate : String;
begin
If rep.AutoSearchFields[0].SearchOperator = soGreaterThan or
rep.AutoSearchFields[0].SearchOperator = soGreaterThanOrEqualTo then
begin
GetDate := rep.AutoSearchFields[0].Value;
if (rep.AutoSearchFields[0].FieldName = 'IssueDate') then
rep.AutoSearchFields[0].SearchExpression := '';
end;
end;
//-----------------------------------------------------------------
How do I pass the string variable "GetDate" back into the report
"CstStm.brp" so I can use it in the BeforePrint event in the report itself
and how do I pick up this variable in the report?
Allan Ryan
This discussion has been closed.
Comments
"into" the report. This way you can code event handlers that reference
ppJITPipeline1['GetDateFieldName'] to perform operations with the string
variable from your Delphi code in your RAP code.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com