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

calling interbase store procedure from the from statement

edited October 2001 in General
hi, in my project i have a store proc that requires 3 params to be called,
and must be called by the from statement.

like, select * from mystoreproc(10, 115, '2001-05-15') ;

all my reports are stored in database, so i'll use an autosearch dialog to
get this values.... that's ok... with a dummy dataview now i have the values
and can get them from rap with Report.GetAutoSearchDescriptionLines.

my question is... how can i do something like mydataview.SQL.Text :=
'select * from ...' in the event OnGetAutoSearchValues in RAP.

Comments

  • edited October 2001
    You can extract the SQL object from the dataview. There is an article on
    this in the TechTips DADE thread. There is an article called 'Access the SQL
    Object via Code.' You can modify the SQLText property of the SQL object.
    Beware, by modifying the sql text, you subsequently can't use the query
    tools to modify the dataview from DADE.

    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited October 2001
    In that article you show a function that return me a SQL object in the aSQL
    param.
    If i make a pass-thru function to this function then change the SQLText in
    the event OnGetAutoSearchValues, the SQL will execute before the report
    generation??

  • edited November 2001
    OnGetAutoSearchValues will fire before the data is retrieved for the report.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited November 2001
    it worked!
    i created a delphi function 'ChangeSQLObject' that sets the property
    EditSqlAsText true, then changing the sql text.
    Call it from the OnGetAutoSearchValues and after relinking the DBTexts to
    the Fields...
    now i can use the autosearch funcionality with a dummy dataview then use my
    own sql to the report.

This discussion has been closed.