sort data during run-time

edited 1:57PM in FastReport 4.0
Hello everybody!

Is it possible to sort data during run-time?

I want to sort groups in FR not in the dataset before preparing the report (not via SQL --> "order by ...").

Or is there a chance to set/store indexfieldnames?


grz

Comments

  • gpigpi
    edited 1:57PM
    wrote:
    Is it possible to sort data during run-time?
    Yes. If your dataset support such feature
  • edited 1:57PM
    gpi wrote: »
    gpi wrote: »
    Is it possible to sort data during run-time?
    Yes. If your dataset support such feature

    how can i do this? Could you explain it for me based on an example?

    thanks
  • gpigpi
    edited 1:57PM
    This is code from my project:
    In Delphi (I use FIBPlus dataset)
    procedure TMainForm.ChangeLimitZaborSort;
    var fields :TStringList;
        ordering: array of Boolean;
    begin
         fields:=TStringList.Create;
         fields.Add('NOMER');
         fields.Add('KOD');
         fields.Add('PRICE_REALIZ');
         SetLength(ordering,3);
         ordering[0]:=true;
         ordering[1]:=true;
         ordering[2]:=true;
         MainDM.TableLimitZabor.DoSortEx(fields,ordering);
         fields.Free;
    end;
    
    function TMainForm.Report_3UserFunction(const MethodName: String;
      var Params: Variant): Variant;
    begin
         if MethodName='CHANGELIMITZABORSORT' then
         ChangeLimitZaborSort;
    end;
    
    in report script:
    procedure Button1OnClick(Sender: TfrxComponent);
    begin
         if CheckBox1.Checked then ChangeLimitZaborSort;
    end;
    

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.