Setting Auto Search parameters for subreports
I can set the AutoSearch parameters using the report parameters as
below. How can I do something similar for subreports?
procedure ReportOnInitializeParameters(var aCancel: Boolean);
var
aParameter: TppParameter;
begin
aParameter := Report.Parameters.Items['ActivityID'];
Report.AutoSearchCriteriaByName(Report.DataPipeline.Name,
'ID').SearchExpression := aParameter.Value;
end;
Thank you
----------
Richard Harding
below. How can I do something similar for subreports?
procedure ReportOnInitializeParameters(var aCancel: Boolean);
var
aParameter: TppParameter;
begin
aParameter := Report.Parameters.Items['ActivityID'];
Report.AutoSearchCriteriaByName(Report.DataPipeline.Name,
'ID').SearchExpression := aParameter.Value;
end;
Thank you
----------
Richard Harding
This discussion has been closed.
Comments
down box which appears to be what I need.
However when I select the required parameter from the list, I receive a
database error.
The generated WHERE clause is below. It does not have a place holder
for the parameter.
WHERE
( Job_1.ID = )
Richard Harding
The main report has a Report.Parameters[ ] property
ChildReports (ie. subreport.Report) do /not/ have a Parameters property.
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Starting with RB 11, you can define Report.Parameters[ ] that optionally
have AutoSearchSettings and LookupSettings. You can also use the Query
Designer to bind a search condition to a Parameter. For the SQL to generate
correctly you need to specify the Parameter DataType and assign a default
value.
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com