Working Principle

The methods implement a standardized print loop that can be used directly for most of the simpler applications if you do not pass the data via DataBinding. In the case of this method, the data is passed within the events DefineVariables and DefineFields to List & Label. This allows any data source to be connected individually. The event arguments allow access to useful information such as user data that has been copied, the Design mode etc. The property IsLastRecord is used to notify the print loop that the last data record has been reached. As long as this is not the case, each event is invoked repeatedly in order to retrieve the data.

The Design method shows the Designer in a modal pop-up window on top of your application window.

You can specify additional options in the LLSetPrintOptions event. Internally, this event is triggered after invoking LlPrintWithBoxStart() but before the actual printing.

One very simple implementation of the Print method looks like this:

Delphi:

procedure TForm1.LLDefineVariables(Sender: TObject; UserData: Integer;

  IsDesignMode: Boolean; var Percentage: Integer;

  var IsLastRecord: Boolean; var EventResult: Integer);

var

  i: integer;

begin

     For i:= 0 to (DataSource.FieldCount-1) do

     begin

         LL.LlDefineVariableFromTField(DataSource.Fields[i]);

     end;

     if not IsDesignMode then

     begin

          Percentage:=Round(DataSource.RecNo/DataSource.RecordCount*100);

          DataSource.Next;

          if DataSource.EOF=True then IsLastRecord:=true;

     end;

end;