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

End-User Report and Program-Supplied Parameters

edited December 2005 in End User
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.)

Comments

  • edited December 2005

    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
  • edited December 2005
    Thank you!
  • edited February 2006
    Is it possible to auto fill some parameter values and have the user supplier
    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.


  • edited February 2006


    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
This discussion has been closed.