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

Refresh SQLText -> Fields

edited July 2007 in End User
I have my reports stored in database (rb_item, .... ). I'm using D7, RB 10
and IBX (Firebird)

I add a new fields in some tables and i want to refresh this fields in the
report (data Tab). I'm using in my program code like this, but sometimes it
works fine and refresh all fields and other no refresh fields...

What's happens ? Can I do it in another form ?



var
aSQL, aSQLAux : TdaSQL ;
aSQLBuilder : TdaSQLBuilder ;
sPipeline : string;
lPipelines : TStrings ;
i, NumInformes : integer ;
begin

QInformes.Active := TRUE ;
QInformes.First ;


while not QInformes.Eof do
begin

Memo1.Lines.Add(' - Item_Id : ' + IntToStr(
QInformes.FieldByName('item_id').AsInteger) + ' - ' +
QInformes.FieldByName('Name').AsString + ' Actualizando ... ' ) ;

try
FInformesF.CargaInformesId(
QInformes.FieldByName('item_id').AsInteger) ; -- Load the report
lPipelines := fInformesF.Querys ; -- name of querys of the
report...
if ( lPipelines.Count > 0 ) then
for i := 0 to ( lPipelines.Count - 1 ) do
begin
sPipeline := Copy(
lPipelines.Strings[i], 7, length( lPipelines.Strings[i] ) ) ;
aSQL := TdaIBXQueryDataView(
FinformesF.Query( sPipeline )).SQL ;
aSQLBuilder := TdaSQLBuilder.Create(aSQL);
asqlbuilder.SQL.EditSQLAsText := FALSE ;
asqlbuilder.SQL.EditSQLAsText := TRUE ;
aSQLBuilder.SQL.ValidateSQLText( asqlBuilder.Sql.SQLText );
aSQLBuilder.ApplyUpdates ;
lSQL.Clear ;
end ;

FInformesF.ppInforme.Template.SaveToDatabase ;
aSQLBuilder.Free ;

.-.....................
Qinformes.Next ;
End ;



--
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 : 96 688 12 88
Fax : 96 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 July 2007

    ----------------------------------------
    Tech Tip: Clearing the Meta Data Cache
    ----------------------------------------

    There is a global meta data cache that the ReportBuilder uses to cache
    information about the available database tables and fields. You can clear
    the meta data cache using the following code.

    uses
    daMetaDataManager;

    begin
    gMetaDataManager.Clear;

    end;

    --
    Tech Support mailto:support@digital-metaphors.com
    Digital Metaphors http://www.digital-metaphors.com


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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited July 2007
    thanks nard, but it doesn't work fine.

    where can i put this code ?



This discussion has been closed.