Re-assigning a data pipelines Datasource.DataSet.OnFilterRecord to a global procedure in RAP?
Is it possible to provide a datasets OnFilter record in RAP to perform
filtering on values that are calculated in the OnCalc event of a dataset.
I have tried creating the following global procedure
procedure FilterRecordsEvent(DataSet: TDataSet; var Accept: Boolean);
begin
Accept := Report.Parameters['HIDE_ZEROS'] = 'N' or
(Actual_Investments['Unit Price ( To Date )'] > 0)
end;
But I cannot assign this in the Global OnCreate event as such...
begin
Actual_Investments.DataSource.Dataset.Filtered := True;
Actual_Investments.DataSource.Dataset.OnFilterRecord := FilterRecordEvent;
end;
I get the error 'GlobalOnCreate, Line 3: Expected '(' or '[', but found
Filtered instead
Can I expose these properties and events of the dataset for use in RAP?
Regards,
Jarrod
filtering on values that are calculated in the OnCalc event of a dataset.
I have tried creating the following global procedure
procedure FilterRecordsEvent(DataSet: TDataSet; var Accept: Boolean);
begin
Accept := Report.Parameters['HIDE_ZEROS'] = 'N' or
(Actual_Investments['Unit Price ( To Date )'] > 0)
end;
But I cannot assign this in the Global OnCreate event as such...
begin
Actual_Investments.DataSource.Dataset.Filtered := True;
Actual_Investments.DataSource.Dataset.OnFilterRecord := FilterRecordEvent;
end;
I get the error 'GlobalOnCreate, Line 3: Expected '(' or '[', but found
Filtered instead
Can I expose these properties and events of the dataset for use in RAP?
Regards,
Jarrod
This discussion has been closed.
Comments
The Data workspace (DADE) is designed to create and link SQL queries and to
define AutoSearch criteria. AutoSearch criteria are used to control which
records are selected.
RAP is designed to control the report elements while the report is
generating and to perform calculations. RAP is not disigned to manipulate
data.
The compile error you are encountering is due to RAP not having run-time
type info about the objects, properties, and methods you are trying to use:
Dataset, etc. RAP is easily extensible, please see the following article:
--------------------------------------------------
Article: Extending RAP
---------------------------------------------------
There are two very simple and powerful techniques to extend the capabilities
of RAP infinitely. These are summarized below and covered in more detail in
the RAP.hlp online help. Demos and tutorials are installed to
RBuilder\Demos\RAP. The tutorial text is located in RAP.hlp.
1. RAP Pass-Through Functions
These are functions that appear in the Language tab of RAP's Code Toolbox.
These functions are written in Delphi and can be called from RAP. RAP's
pass-through function architecture enable's developers to add new built-in
functions to RAP's code toolbox.
2. Extend RAP's RTTI
RAP's Run-time Type information defines what classes and properties can be
accessed via RAP. By default the published properties of any class that is
registered with Delphi's RegisterClass procedure is recognized by RAP. In
addition many of the public properties and methods of ReportBuilder classes
are exposed.
--
Tech Support mailto:support@digital-metaphors.com
Digital Metaphors http://www.digital-metaphors.com
--
Nard Moseley
Digital Metaphors
http://www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com