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

Change SQL Statement and fiedls not refresh ...

edited June 2005 in End User
I need to change SQL of a Report... I load the report, change sql, and
save.... I'm working whith ibx, delphi 7 and RB 7.04 ..

when i see the report in Explorer the SQl statement has changed but the
fields of sql are the olders How can I create the new fields ?

the source code is below .... what its wrong ...


Report1.Template.FileName := 'c:\prueba.rtm' ;

Report1.Template.LoadFromFile ;

TdaIBXQueryDataView( Report1.....).SQL.MagicSQLText.Text := 'Select * from
Customers';

FInformesF.ppInforme.Template.SaveToFile ;

--
thanks...


Jaime Lloret.
ISCOPYME, S.L.



ISCOPYME, S.L.
Ingenier?a del Software y Consulting para la PYME.
Servicios Inform?ticos.

Tel : 966 688 12 88
Fax : 966 688 20 29
C/ Pintores, N? 19.
03590 - ALTEA - Alicante
Espa?a.

www.iscopyme.com
Administraci?n : admin@iscopyme.com
Depto. Software : soft@iscopyme.com
SAT : sat@iscopyme.com


--
Un saludo


Jaime Lloret.
Jefe de Desarrollo de Proyectos Software.
ISCOPYME, S.L.

CL?USULA DE CONFIDENCIALIDAD: ISCOPYME, S.L garantiza la confidencialidad de
los datos que obran en su poder y seg?n lo estipulado por la LOPD (Ley
Org?nica 15/1999 de 13 de diciembre de Protecci?n de Datos de Car?cter
Personal). Este mensaje se dirige exclusivamente al destinatario consignado.
Puede contener informaci?n confidencial, de nuestra propiedad o legalmente
protegida. Si usted no es el destinatario, le informamos que cualquier
acceso, divulgaci?n, copia o distribuci?n de la informaci?n, as? como
cualquier acci?n u omisi?n realizada con base a la misma, queda prohibida y
puede ser ilegal. En caso de haber recibido este mensaje por error, le
rogamos que nos lo reenv?e y notifique inmediatamente, borrando toda copia
de su sistema. Gracias.


ISCOPYME, S.L.
Ingenier?a del Software y Consulting para la PYME.
Servicios Inform?ticos.

Tel : 966 688 12 88
Fax : 966 688 20 29
C/ Pintores, N? 19.
03590 - ALTEA - Alicante
Espa?a.

www.iscopyme.com
Administraci?n : admin@iscopyme.com
Depto. Software : soft@iscopyme.com
SAT : sat@iscopyme.com

Comments

  • edited June 2005
    I'm working with RB 7.04 and I need to do it automatically because i need to
    change SQL about 100 reports of all my Customers ( 75) and
    I can't to do it manually

    Any Idea ?

    Thanks
    "Jaime LLoret" escribi? en el mensaje
  • edited June 2005

    Some observations:

    1. The TdaSQL.SQLText property provides access to the SQL text (MagicSQL is
    used internally when generating linking SQL).

    2. If you originally used the Query tools to build the queries, then you
    should not alter the SQLText directly. This will lose the ability to use the
    Query Designer to maintain the query and will result in loss of linking and
    autosearch support. (See article below).

    For RB 9 we added a TdaSQLBuilder class that can be used to programmatically
    modify the TdaSQL. For older version of RB, you need to extract the TdaSQL
    object from the dataview and modify it using its properties such as
    SelectTables, SelectFields, etc. This is undocumented, but we do have an
    example.

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



    ----------------------------------------------
    Tech Tip: Limitations of using TdaSQL.SQLText
    ----------------------------------------------

    The TdaSQL object can contain either an object based description of the SQL
    (SelectTables[], SelectFields[], etc.) that it uses to generate SQLText OR
    it contain a SQLText string. If you specify the SQLText string then TdaSQL
    will not generate any SQLText. Therefore the built-in AutoSearch and Linking
    features can no longer be used - because these require that special SQLText
    be generated.

    If you want to use AutoSearch with a SQLText, you will need to handle this
    in your custom dataview code. For an example see RBuilder\Demos\AutoSearch
    and see the TdaQueryDataView.CreateAutoSearchFields and
    TdaQueryDataView.ReportGetAutoSearchValuesEvent methods in
    daQueryDataView.pas.







    --
    Nard Moseley
    Digital Metaphors Corporation
    http://www.digital-metaphors.com


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.