Autosearch fields shown on the report as "User Friendly" names
I woulds like to show an autosearch field in my report in a user friendly
way.
The code that I have used is:-
begin
if (Report.AutoSearchCriteriaByName
('booking','use_client_ins').value = null)
or (Report.AutoSearchCriteriaByName
('booking','use_client_ins').value = '')
then Value := 'All'
else
if Report.AutoSearchCriteriaByName
('booking','use_client_ins').value = 0
then Value := 'False'
else Value := 'True';
end;
The True/False bit works OK, but its the "All" value that is causing
errors. It seems that the variable is not passed a value for
Report.AutoSearchCriteriaByName('booking','use_client_ins') if the "All"
option on the report parameter interface is used.
How can I get the report to show "All" if the "All records" have been
selected?
Thanks
--- posted by geoForum on http://delphi.newswhat.com
way.
The code that I have used is:-
begin
if (Report.AutoSearchCriteriaByName
('booking','use_client_ins').value = null)
or (Report.AutoSearchCriteriaByName
('booking','use_client_ins').value = '')
then Value := 'All'
else
if Report.AutoSearchCriteriaByName
('booking','use_client_ins').value = 0
then Value := 'False'
else Value := 'True';
end;
The True/False bit works OK, but its the "All" value that is causing
errors. It seems that the variable is not passed a value for
Report.AutoSearchCriteriaByName('booking','use_client_ins') if the "All"
option on the report parameter interface is used.
How can I get the report to show "All" if the "All records" have been
selected?
Thanks
--- posted by geoForum on http://delphi.newswhat.com
This discussion has been closed.
Comments
Try checking the TppAutoSearchField.ShowAllValues property to determine
whether the user selected the All Records option. Something like the
following...
begin
if (Report.AutoSearchCriteriaByName
('booking','use_client_ins').value = null)
or (Report.AutoSearchCriteriaByName
('booking','use_client_ins').ShowAllValues)
then Value := 'All'
else
if Report.AutoSearchCriteriaByName
('booking','use_client_ins').value = 0
then Value := 'False'
else Value := 'True';
end;
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com