Auto search params display on Report?
I have a end user defined report that has a single auto search field that is
a date. I'm using the date to get all orders that are past due based on
this date. Now I would like to display this auto search date in the title
of the report so the user knows the context that the report ran in.
Thanks,
Eric Lyons
a date. I'm using the date to get all orders that are past due based on
this date. Now I would like to display this auto search date in the title
of the report so the user knows the context that the report ran in.
Thanks,
Eric Lyons
This discussion has been closed.
Comments
Use either Report.AutoSearchDiscription or
Report.GetAutoSearchDescriptionLines. The following code is taken from the
RBuilder\Demos\5. AutoSearch\5. Build Description of AutoSearch Settings
example:
procedure TForm1.ppMemo1Print(Sender: TObject);
begin
{note: you can use either of these based on preference}
{ ppMemo1.Lines.Text := ppReport1.AutoSearchDescription;}
ppReport1.GetAutoSearchDescriptionLines(ppMemo1.Lines);
end;
--
Nard Moseley
Digital Metaphors
http://www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
any code by the scenes. I using the report explorer and a designer to let
the user create any number of reports. All of these reports are created
just using the designer and creating dataviews to run against. So I can't
write any code for this functionlity. I think I know the answer to my
question is that it's not possible to get the auto search parameters to
display on the report but it would be a nice feature if all search
parameters showed up as a system calculated value, maybe there is a way I
can create an addin to do this. How are the system calculated values
generated?
Thanks,
Eric Lyons
You can add the appropriate logic using RAP, in case you were not aware:
1) Put a memo field in your report header (or title).
2) On the Calc tab, you or the end user, could create code behind the
Report's 'BeforePrint' event. That code would simply need to look like
this:
procedure ReportBeforePrint;
begin
Report.GetAutoSearchDescriptionLines(Memo1.Lines)
end;
I would agree that for some users, this might be a formidable task. In a
recent application, I created my own component which resides on a toolbar
in the report designer. My code is a little more complicated than you
need because I am doing some behind-the-scenes manipulation of
information, but if you look at some of the demos for creating a custom
component, hopefully you will find that adding a simple component to the
toolbars is quite straightforward.
If you derive your custom component from a TppMemo, then all you really
need to do is to create an Onprint method for the Memo that clears the
lines and calls the GetAutoSearchDesctionLines method.
Then all your users will need to do is drop this special memo onto their
reports and you should be all set.