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

TdaSQLBuilder

edited May 2007 in RAP

Hello
in 10.x i could modify with TdaSQLBuilder the data tab. But in datatab i
have the option to change also the SQL text. It is not reversable, thats ok.
how can i do this also in RAP?

--
best regards
chris (EULANDA)

www.eulanda.com
ERP SOLUTIONS

Comments

  • edited May 2007
    Here a sample, SQL is Readonly..., but on Datatab i could do it. I need it
    in RAP because i have to youse a SQL function with parameters.

    procedure TextTitelOnDrawCommandClick(aDrawCommand: TObject);
    var
    lSQLBuilder: TdaSQLBuilder;
    begin

    lSQLBuilder := TdaSQLBuilder.Create(Report.DataPipeline);
    lSQLBuilder.Sql :='SELECT * FROM ADRESSE Where ZIP<1100';

    lSQLBuilder.ApplyUpdates;

    lSQLBuilder.Free;

    RestartReport(Report, TppDrawCommand(aDrawCommand));

    end;

    --
    best regards
    chris (EULANDA)

    www.eulanda.com
    ERP SOLUTIONS
  • edited May 2007
    Hi Chris,

    The TdaSQLBuilder object was designed to allow you to easily alter the SQL
    without having to actually use SQL code. Changing the query to use the SQL
    code you have below should be very easy using the built-in routines to
    select fields and adjust the search condition with the TdaSQLBuilder.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited May 2007
    Hi Nico,
    i think this is not possible, because i have no table to select and RB did
    not support sql build in functions with parameter.
    So i can go to the data tab and change the sql code directly. If i code the
    sql manually i can use functions also with parameter, but the enduser could
    not open the data tab and change sql source. So my idea was to do it with
    TdaSQLBuilder. It has a property SQL (readonly), bit the TdaSQL can change
    ist. So i need it do to in RAP, because i have some Editboxes (buidl as Pass
    through) to type in the values for the parameter. But how an i pass them to
    a sql function?
    The Datatab did onlny accept Tables and Views not functions.

    so my idea was to do the same by rap what i can do by right mouse on the SQL
    code page of te datapipeline.
    Is tehre any trick to do it?

    --
    best regards
    chris (EULANDA)

    www.eulanda.com
    ERP SOLUTIONS
  • edited May 2007
    Hi Chris,

    Sorry, I'm a bit unclear about the problem. Are you trying to access a
    stored procedure on your database? In this case you can create a custom
    dataview to access and adjust the parameters of the stored proc. Take a
    look at the example located in the \RBuilder\Demos\4. EndUser Databases\SQL
    Server\2. ADO\StoredProc\.. .directory on how this can be done.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited June 2007
    Hi Nico,

    the normal way, that is actually working is, to go to the data tab and on
    the pipeline the last Icon (SQL), right mouse and press "Change". In this
    case i can insert complete free SQL.
    I am searching the same functionality in the TdaSqlBuilder object. So i can
    (by some pass through) get my parameters, build the sql and assign it and
    then restart the report.


    --
    best regards
    chris (EULANDA)

    www.eulanda.com
    ERP SOLUTIONS
  • edited June 2007


    TdaSQLBuilder.Sql provides access to the TdaSQL object, so try something
    like...

    lSQLBuilder.Sql.SqlText.Text := 'SELECT * FROM ADRESSE Where ZIP<1100';


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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited June 2007
    Thank you Nard,

    at first it did not worked. But the trick is:
    1. to make on datatab a new datapipline, regardless what table.
    2. Then go to the SQL tab and right mouse to insert some working Dummy code
    like
    SELECT 'HELLO'

    3. Then use your statement.

    so thank you again

    --
    best regards
    chris (EULANDA)

    www.eulanda.com
    ERP SOLUTIONS
This discussion has been closed.