Home General

Passing Autosearch parameters

edited October 2001 in General
I am using a report template stored in a database. The template contains an
autosearch field that displays a dialog requesting a value when the report
is run. The report is connected to the database via the ReportDesigners
DatabaseName property. However, I want to call the same template from my
application and pass the field values directly so the autosearch dialog does
not pop-up.

I know how to set the ppReport1.template.DatabaseSettings.Name property but
I would have thought code like should work:

ppReport1.template.DatabaseSettings.Name := 'Docket';
ppReport1.template.LoadFromDatabase;
if assigned(ppReport1.AutoSearchFieldByName('JobID')) then
ppReport1.AutoSearchFieldByName('JobID').AsString := '46669';
ppReport1.Print;

How do I do this? The AutoSearchFieldByName returns the Field ok but the
value properties are read-only! Also the OnGetAutoSearchValues event seems a
bit weird as it doesn't get a value at all but merely provides an
opportunity to provide such values to be used in the query that provides the
data for the report. In my case there is no such query as I choose to handle
the entire think in the report template.

The demo examples don't seem to cover this particular issue. Any thoughts?

Thanks in advance

Paul van Dinther

Comments

This discussion has been closed.