How to add a field for JIT with code ?
procedure TFrmGz.Button1Click(Sender: TObject);
var
x:TppField;
begin
x:=TppField.Create(nil); // or x:=TppField.Create(self) or x:=
TppField.Create(ppJITPipeline1) , the results are same!
with x do
begin
FieldName:='aa';
FieldAlias:='aa';
end;
ppJITPipeline1.AddField(x);
ppDesigner1.ShowModal;
end;
--------------------------------------------------------------
I can view the field when ppDesigner shows.But when I close the main form ,
an error occurs 'invalid pointer'.
What is the proper method ?
Thank you.
var
x:TppField;
begin
x:=TppField.Create(nil); // or x:=TppField.Create(self) or x:=
TppField.Create(ppJITPipeline1) , the results are same!
with x do
begin
FieldName:='aa';
FieldAlias:='aa';
end;
ppJITPipeline1.AddField(x);
ppDesigner1.ShowModal;
end;
--------------------------------------------------------------
I can view the field when ppDesigner shows.But when I close the main form ,
an error occurs 'invalid pointer'.
What is the proper method ?
Thank you.
This discussion has been closed.
Comments
procedure TForm1.ConfigurePipelines);
procedure AddJITField(aPipeline: TppJITPipeline; aDataType: TppDataType;
aFieldName: String; aSize: integer = 0 );
var
lField: TppField;
begin
lField := TppField.Create(aPipeline.Owner);
lField.DataType := aDataType;
lField.FieldLength := aSize;
lField.FieldName := aFieldName;
lField.DataPipeline := aPipeline;
end;
begin
FMasterJIT := TppJITPipeline.Create(self);
FMasterJIT.Name := 'plHypotheticalReturnValues';
FMasterJIT.OnGetFieldValue := GetMasterFieldValue;
FMasterJIT.RecordCount := 1;
AddJITField(FMasterJIT, dtstring, STR_Title);
AddJITField(FMasterJIT, dtMemo, STR_Disclaimer);
AddJITField(FMasterJIT, dtDouble, STR_CurrentValue);
...
HTH
Ed Dressel
Team DM