populate ComboBox from query

edited 2:05AM in FastReport 4.0
Hy, my question is how to populate DialogPage ComboBox with results from a Query?

I've tried the following code:

VAR SQLQuery1 : String;

procedure ListBox1OnEnter(Sender: TfrxComponent);
begin
SQLQuery1 := 'Select F_ACRONYM from Customer';
ListBox1.Items.Add(ToStr(QueryValue(SQLQuery1)));
end;

My problem is that I can't get all the names from the result in my ComboBox, it takes only the first name.

Can anyone help me?

regards,
CsAlex

Comments

  • gpigpi
    edited 2:05AM
    var DS: TfrxDataSet;
    begin
        DS:=Report.GetDataset('Items');
        DS.First;
        while not DS.Eof do      
          begin          
            ListBox1.Items.Add(DS.Value('Part Name'));
            DS.Next;
          end;        
    end.
    
  • edited 2:05AM
    gpi wrote: »
    var DS: TfrxDataSet;
    begin
        DS:=Report.GetDataset('Items');
        DS.First;
        while not DS.Eof do      
          begin          
            ListBox1.Items.Add(DS.Value('Part Name'));
            DS.Next;
          end;        
    end.
    

    Thank you gpi, works perfectly [img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />. Have a nice week![/img]

Leave a Comment