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

Report Update sql

edited May 2002 in General
Is it possible, to insert a SQL Filter at runtime ?
I have a report, and would like to set a specific filter, but because the
filter is very complex, i would like to use the same filter, which i used to
show in a listview for the report.
Is it possible to edit the sql Command before it is executed ?

thanxs in advance
Andreas

Comments

  • edited May 2002
    Please see the 'How to Change the CommandSQL???' post from 5/10/02 7:41AM

    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

  • edited May 2002
    I am not sure if it is exactly what i need ..... will look

    because i need to insert a whole WHERE clausle into the sql command

    for example sqlWhere := 'DATE1 > ''24.10.2001'' AND DATE2 > ''10.4.2002''
    AND (STATUS = 1 OR DATE1 = null)';

    i have this in a form, and would like to enter this Where Command in a
    OnBeofrePrint of the ReportBuilder (not within Delphi, it should be possible
    within ReportBuilder)

    thanks
    Andreas

    "Alexander Kramnik (Digital Metaphors)" schrieb
  • edited May 2002
    You can define search criteria on the report. You can default the search
    criteria to ShowAll = True. If ShowAll is true, then you can run the report
    and no search criteria will be applied (ie. no WHERE clause). Then you can
    choose the autosearch icon in the previewer and the auto search dialog will
    display and you can enter search parameters which will be applied to the SQL
    where clause. Please see the autosearch demos in your installation
    RBuilder\Demos\Autosearch.


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited May 2002
    But the problem is that i didn't know the sql-where string, that string is
    built dynamically depending from the user input.
    Now it would be very very nice, if i can take this generated where sql
    command and place it in the sql command of Report Builder.
    In the other way, i have to build the whole sql command (or filter) twice
    for my application and for Report Builder.

    regards
    Andreas


  • edited May 2002
    You can pull out the SQL text of the report, which is generated in DADE, and
    copy it to your form, without having to print the report:

    An example of GetSQLObject can be found in this demo:
    http://www.digital-metaphors.com/tips/ExtractSQLObject.zip

    procedure TForm1.ShowSQLText;
    var
    lSQL: TdaSQL;
    begin

    GetSQLObject(ppReport1, lSQL);

    Showmessage(lSQL.MagicSQLText.Text);

    end;


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.