Search code examples
delphirave-reports

Get list of Rave Reports in delphi


I have a Rave Report Project that contains few reports ( 4 to 6) and I would like to add them into a combobox so that the user can select which report he wants to use. How can I get the list of Reports i've got into the Rave Report Project and pass it to the combobox.

procedure TForm1.Button4Click(Sender: TObject);
var
 i: Integer ;
 list : TStrings;
begin
   RvProject1.GetReportList(list,True)   ;
        for i := 0 to list.Count - 1 do

    ComboBox1.AddItem(list[i],nil);
end;

I've tried this, but it doesn't work, i get an Access Violation at adress... error. Anyone can help me with a solution?


Solution

  • I found my solution. I've had to make an instance of the list string list passed to the GetReportList method:

    procedure TForm1.Button4Click(Sender: TObject);
    var
      list: TStringList;
    begin
      list := TStringList.Create;
      try
        RvProject1.GetReportList(list, True);
        ComboBox1.Items.Assign(list);
      finally
        list.Free;
      end;
    end;