Dsplay search criteria on report?
Hi,
Someone asked previously how you might be able to display the user's chosen
criteria on a report. It was suggested that the
Report.GetAutosearchDescriptionLines would do the trick. However, if I am
right, this cannot be called from RAP? How can I simply display the results
of the criteria in the report header from the end-user facility? Is there a
sample report (rtm) that shows how to do this?
Thanks
Alex
Someone asked previously how you might be able to display the user's chosen
criteria on a report. It was suggested that the
Report.GetAutosearchDescriptionLines would do the trick. However, if I am
right, this cannot be called from RAP? How can I simply display the results
of the criteria in the report header from the end-user facility? Is there a
sample report (rtm) that shows how to do this?
Thanks
Alex
This discussion has been closed.
Comments
procedure with a parameter for aLines??? Can't find any samples or doco in
the help files, so any examples of how to assign the contents of the search
fields to a displayable calc field on the report would be very appreciated.
Thanks
Alex
you have to pass a 'TStrings' object, usually a 'TStringList', the method fills the list with the criteria informations.
To use it within RAP create a pass-through function.
regards,
Chris Ueberall;
I have been through the pass-through examples. Can you give me an example
of what the pass-through code for getting criteria into a stringlist would
involve as I am moving a little out of my depth at the moment? I didn't
realise being able to simply print the user selected criteria on a report
would become this involved. Wouldn't it make sense to have such a function
as standard functionality, being I would assume a very common requirement?
Cheers
Alex
it is simpler as I thought in my last answer. You don't need a pass-through function, because RAP RTTI is already implemented for that method. But there should be some information about that method in the help file, missing that.
I used the following in the global 'OnCreate' event:
Report.GetAutoSearchDescriptionLines(Memo1.Lines);
which worked for me.
regards,
Chris Ueberall;
Can anyone tell me how to implement that on user side.
Let's say that user has created one report with custom search criteria. How
can he see that criteria in his report at once.
Is there any example of that.
Sorry, for posting maybe double thread...
Damir
AutoSearch\7. Create EndUser AutoSearch Fields" but have question how to
localize that expression to other language (not supported by RBuilder) or to
see the source so I can override that "GetAutoSearchDescriptionLines"
function to display other language....
THX!
translated. Make sure you change the Report.Language property and see the
RBuilder\Languages\ReadMe.doc for deployment info.
This is used to get the description for an autsoearch field:
From the help file:
Returns a full description of the search condition contained in the
AutoSearchField. How the description begins depends upon the value of the
FirstField property. A typical description: 'Show all data where the
company
name begins with 'T%'. For an example of how to use the description, see
the
demo in the...RBuilder\\Demos\\AutoSearch\\6. Build Description of
AutoSearch
directory.
function TppAutoSearchField.Description: String;
begin
if (FirstField) then
Result := ppLoadStr(54) {Show all data where the}
else
Result := ppLoadStr(55); {and the}
if (ShowAllValues) then
Result := Result + ' ' + FieldAlias + ' ' + ppLoadStr(1036) {'has any
value'}
else
Result := Result + ' ' + FieldAlias + ' ' + OperatorDesc + ' ' +
SearchExpression;
end; {function, Description}
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com