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

End User Create Reports and parameters

edited February 2006 in End User
Hi there

We use PostgreSQL, and a specific schema, depending on what user is logged
in.

I have created on my Report some parameters.eg A FromDate and a ToDate.

I saw there was a way to programmatically fill in the parameters, but what I
would like to do, is fill in the Schema parameter programmatically, and have
the user define the From/To Date parameters. Is this possible?

Also are the parameters Filters or are they applied to the SQL statement?

Comments

  • edited February 2006

    Query search parameters are used to dynamically generate the where clause of
    the SQL text. (RB does not use filters.).

    For the parameters that you do not want to be autosearch you can do one of
    the following.

    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
  • edited February 2006
    thanks a lot, sounds good, and I willl give it a try
This discussion has been closed.