streaming custom published propertys on TdaDataModule
Hello
I have added two extra published properties to the TdaDataModule, that I
read while the user is designing the data views.
eg TdaDataModule = class(TppReportModule)
...
published
property MyPropString: string read FMyPropString write
FMyPropString ;
property MyPropInt: integer read FMyPropInt write
FMyPropInt;
end;
I was hoping that they would automatically be saved into the Template when i
use the TdaDataModule.Template functions to save the template to file. The
good news is they are saving OK, and i can see them if i save it as ASCII,
however they do not load back from the stream???
Below is the Template file after saving blank data module from data design
window....
object TdaDataModule
MyPropString = 'Cameron'
MyPropInt = 1
end
I am not too familiar with component streaming, but is something configured
inside the Template.LoadFromDatabase function to not stream back custom
properties?
any help is greatly appreciated
Cameron Hart
I have added two extra published properties to the TdaDataModule, that I
read while the user is designing the data views.
eg TdaDataModule = class(TppReportModule)
...
published
property MyPropString: string read FMyPropString write
FMyPropString ;
property MyPropInt: integer read FMyPropInt write
FMyPropInt;
end;
I was hoping that they would automatically be saved into the Template when i
use the TdaDataModule.Template functions to save the template to file. The
good news is they are saving OK, and i can see them if i save it as ASCII,
however they do not load back from the stream???
Below is the Template file after saving blank data module from data design
window....
object TdaDataModule
MyPropString = 'Cameron'
MyPropInt = 1
end
I am not too familiar with component streaming, but is something configured
inside the Template.LoadFromDatabase function to not stream back custom
properties?
any help is greatly appreciated
Cameron Hart
This discussion has been closed.
Comments
looking into the source in a bit more depth i found that you transfered a
temporary copy of the datamodule into my datamodule.
Therefore to get it working i had to add a overrided Transfer procedure into
the TdaDatamodule that also copies my custom fields.
following along on the example i gave in the first post, here is the
transfer code
procedure Transfer(aSource: TppCommunicator); override;
procedure TdaDataModule.Transfer(aSource: TppCommunicator);
var lDataModule : TdaDataModule;
begin
inherited Transfer(aSource);
lDataModule := TdaDataModule(aSource);
FMyPropString := lDataModule.FMyPropString;
FMyPropInt := lDataModule.FMyPropInt ;
end;
hope this helps someone
cam