End-User Report and Program-Supplied Parameters
In an application that provides end-use report creation, including
"Auto-Search" parameters, I wish to execute the report by loading the RTM
file and supplying the parameters from the program (rather than using the
prompt to get user entry.) Is this possible? How?
The intent is to let the end-user design the report and query but supply the
parameters from the program at execution time (avoiding the keyboard entry.)
"Auto-Search" parameters, I wish to execute the report by loading the RTM
file and supplying the parameters from the program (rather than using the
prompt to get user entry.) Is this possible? How?
The intent is to let the end-user design the report and query but supply the
parameters from the program at execution time (avoiding the keyboard entry.)
This discussion has been closed.
Comments
Use the Report.BeforeAutoSearchDialog event to initialize the
AutoSearchField values and set Report.ShowAutoSearchDialog to False,.
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
other ones.
Eg we are working on Postgres and we use schemas, depending on which user is
logged into the application. So in code it should automatically supply the
schema name to work with, but the user must enter for example a To and From
Date.
1. You can use the Query Designer to add search criteria that are not
autosearch. Then use the TdaSQLBuilder class (introduced in RB 9) to udpate
the search value. Use the Report.OnInitializeParameters or
Report.BeforeOpenDataPipelines events.
See TdaSQLBuilder in the RBuilder.hlp.
2. The other solution is to modify the DADE plug-in code to modify the SQL
at the time it is assigned to the dataset. Some customers do this when
implementing login type of security - that way the user does not see the
additional SQL. The QueryDataView SQLChanged method takes the SQL string
generated by the TdaSQL object and assigns it to the query dataset. This is
the point at which you could modify the SQL string.
Example:
var
lSQLText: TStringList;
begin
lSQLText := TStringList.Create;
// get sql text from TdaSQL object
lSQLText.Assign(SQL.MagicSQLText);
// add code to the modify the sql text
// assign sql text to query dataset
FQuery.SQL.Assign(lSQLText);
lSQLText.Free;
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com