We help IT Professionals succeed at work.

f1book-storing as excel file.

shyampaliyath
on
this problem is in reference to the earlier posted question. i could able to retrive the data stored in the oracle database and show it in the f1book which is a activex component of delphi but i could not able to store this retived data in the excel file format. the code so far written is given below.
procedure TForm1.Button1Click(Sender: TObject);
VAR
I,J: INTEGER;
begin
     SHOWMESSAGE(trim(EdtTableName.Text));
     with query1 do
     begin
          close;
          sql.clear;
          sql.add('SELECT * FROM '+ TRIM(EdtTableName.Text));
          open;
     end;
     FOR  I:=0 TO QUERY1.FieldCount-1 DO
     BEGIN
          F1BOOK1.ColText[I+1]:=QUERY1.Fields[I].FieldName;
     END;
     J:=1;
     QUERY1.First;
     WHILE NOT QUERY1.EOF DO
     BEGIN
          FOR I:=0 TO QUERY1.FieldCount-1 DO
          BEGIN
               F1BOOK1.TextRC[J,I+1]:=QUERY1.FIELDBYNAME(QUERY1.Fields[I].FieldName).ASSTRING;
          END;
          J:=J+1;
          QUERY1.Next;
     END;
end;
Comment
Watch Question

Commented:
Before last 'end' paste

F1Report.Write(FileName,FilterIndex);

FilterIndex: 2 - Excel 4
             4 - Excel 5