Home DADE

How to access Report Parameters from TdaDataSet descendant

edited November 2007 in DADE
Hi

I would like to access the report parameters or the values of the report
autosearch fields from a TdaDataSet descendant class.
I use TdaClientDataSet = class(TdaDataSet) and then in procedure
TdaClientDataSet.GetFieldsForSQL(aList: TList; aSQL: TStrings) i would like
to change the SQL using the values of the autosearch field(s). I am using
version 7.04
Any help?
Thanks in advance

Regards
Robert Merle

Comments

  • edited November 2007

    What are you trying to accomplish? Please provide more details.

    - Here is an example of using ReportBuilder's DADE with Delphi's
    DataSnap/Midas architecture...

    www.digital-metaphors.com/tips/RBEndUserWithDataSnap.zip

    - Typically TdaDataSet would be used to get meta data about the Fields of a
    DataSet. This could occur prior to and independent of any report autosearch
    dialog being displayed. For example when you use the Query tools, the ask
    the DADE plug-in to provide a list of available tables. The user picks a
    table and then the Query tools as the DADE plug-in to provide a list of
    fields. To get the list of fields, the plug-in creates a TdaDataSet.


    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited December 2007
    Designing reports
    I design reports by using the Query Designer. I can link togeter the tables
    and fields and use autosearch fields to ask the user for parameter values.
    For example I often want to retrieve some data that is in a certain period
    of time. I then use a startdate autosearch field and an enddate autosearch
    field to ask the user for a startdate and an endate. Then the report will
    retrieve the data for the given period of time. This works fine to me.
    Sometimes however the data to retrieve is to complicated (when I want to use
    unions or specific ORacle functions) and the I chose "Edit SQL" on the SQL
    tab. Now I miss the possibility to use autosearch fields to ask the user for
    parameter values. To solve this problem I have the idea of using a certain
    tagvalue in the hardcoded query (e.g. "select orderdate from orders where
    orderdate <= #TAGVALUE_ORDERDATE#"). This tagvalue should ask the user for a
    parameter value and retrieve the data filtering on that parameter value.
    However when I want to save the query with the tagvalue I get an error in
    TdaDataset, because the query cannot be opened. So I need a way to replace
    the tagvalue with a parameter value (in the example the query could then be
    "select orderdate from orders where orderdate <
    TO_DATE('03-12-2007','DD-MM-YYYY')). I cannot find a way to replace the
    tagvalue with a value of my own before saving the query in the designer (I
    cannot find a way at all to comminucate between the report and dataset).

    Running reports
    Later on when running the report the user should be asked for a parameter
    value for every tagvalue defined and the data should be retrieve filtering
    on the parameter value(s)

    I hope this makes things clear

    Regards
    Robert

This discussion has been closed.