Ouch! Please consider it. When a parameter is connected to an autosearchvalue the autosearch value is also not accessible from Reports.AutosearchValues[], making connecting a parameter to a query a lot less interesting. Eg. I use OnInitializeParameters() to init a weekreport with dynamic default dates for a query so a user most of the time only clicks OK.
The limitation can currently be worked around by creating a simple pass thru function.
Do you perhaps mean the Report.AutoSearchFields[].Value property? This is a read only property. If you would like to assign a value to an AutoSearchField, you should use the Report.AutoSearchFields[].SearchExpression property. This however is not necessary if the parameter value is updated while connected to the AutoSearch field.
class function TRapSetReportParameter.GetSignature: String; begin Result := 'procedure SetReportParameter(aReport: TppReport; aParameter: string; aValue: Variant);'; end;
class function TRapSetReportParameter.IsFunction: Boolean; begin Result := False; end;
procedure TRapSetReportParameter.ExecuteFunction(aParams: TraParamList); var lReport: TppReport; lParam: string; lValue: Variant; begin GetParamValue(0, lReport); GetParamValue(1, lParam); GetParamValue(2, lValue); if Assigned(lReport) then lReport.Parameters[lParam].Value := lValue; end;
Comments
This is currently a limitation of RAP. We are strongly considering adding
this capability for the next major release of ReportBuilder.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Ouch! Please consider it.
When a parameter is connected to an autosearchvalue the autosearch value is
also not accessible from Reports.AutosearchValues[], making connecting a
parameter to a query a lot less interesting.
Eg. I use OnInitializeParameters() to init a weekreport with dynamic default
dates for a query so a user most of the time only clicks OK.
Regards,
Jeroen.
The limitation can currently be worked around by creating a simple pass thru
function.
Do you perhaps mean the Report.AutoSearchFields[].Value property? This is a
read only property. If you would like to assign a value to an
AutoSearchField, you should use the
Report.AutoSearchFields[].SearchExpression property. This however is not
necessary if the parameter value is updated while connected to the
AutoSearch field.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
thru
Didn't think about that. Will try that next week.
Regards,
Jeroen.
That seems to work as aspected.
{ TRapSetReportParameter }
class function TRapSetReportParameter.GetSignature: String;
begin
Result := 'procedure SetReportParameter(aReport: TppReport; aParameter:
string; aValue: Variant);';
end;
class function TRapSetReportParameter.IsFunction: Boolean;
begin
Result := False;
end;
procedure TRapSetReportParameter.ExecuteFunction(aParams: TraParamList);
var lReport: TppReport;
lParam: string;
lValue: Variant;
begin
GetParamValue(0, lReport);
GetParamValue(1, lParam);
GetParamValue(2, lValue);
if Assigned(lReport)
then lReport.Parameters[lParam].Value := lValue;
end;
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com