Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Autosearch fields shown on the report as "User Friendly" names

edited March 2006 in General
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

Comments

  • edited March 2006
    Hi Tripoint AC,

    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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.