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

How to add complete SQL Statement to TdaSQL

edited February 2003 in RAP
Hallo,

is possible to add whole SQL Statement to TdaSQL object and how?

I tried with :
if GetSQLObject(aReport,aSQL) then begin
aSQL.SQLText:= stSQL;
where stSQL is TStringList and contains the complete SQL Statement.

The troubles appeared by designer at runtime. I couldn't more look at the
calculation field, search field and others.

Greetings,
Stasa

Comments

  • edited February 2003
    Hi Jerinic,

    you can't assign a 'TStringList' to 'String'. You could assign 'stSQL.Text' instead.
    IIRC you have to use property 'aSQL.MagicSQL(.Text)' not 'SQL', but I may wrong in this point. Don't forget to set property 'aSQL.EditSQLAsText' to 'True'.
    In addition you may search here or in the enduser group, there are a lot of examples available.

    HTH,
    Chris Ueberall;
  • edited February 2003
    It looks, as if there is a problem with the designer, if you change the
    SQL-Text either by code as Stasa wants or at design time.

    Try this:

    - Open the report in the designer
    - Create a new SQL-Statement (remeber to have the "edit SQL Text" checked)
    - edit the newly created SQL-Text
    -Then every click on the groups, sort, calc-Tabs will produce an AV

    Is this WAD?

    Cheers
    Bernd
  • edited February 2003
    Hi Bernd,

    the tabs should disappear after setting 'Edit SQL as Text' to 'True'.

    regards,
    Chris Ueberall;
  • edited February 2003
    There is a bug at delphi design time if you edit the SQL text. You'll have
    to edit the SQL text at runtime to work around the problem.

    When you do edit the SQL text, you will lose all the query tool support,
    because DADE generates SQL and if you edit the SQL, then we can't use the
    objects you've defined int eh dataview to generate SQL that will merge with
    your changes.

    YOu can either use our query tools, edit the TdaSQL object at runtime by not
    editing the SQLText or edit the SQLText.

    Here is an example of editing the TdaSQL object in the preferred way instead
    of editing the SQLText.
    http://www.digital-metaphors.com/tips/ExtractSQLObject.zip

    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.