« Execute (TQueryExecuteTask ) » : différence entre les versions
Aucun résumé des modifications |
Aucun résumé des modifications |
||
Ligne 45 : | Ligne 45 : | ||
var qbe:TQueryExecuteTask; doc:TxmlDocument; AStr,AReason:string; | var qbe:TQueryExecuteTask; doc:TxmlDocument; AStr,AReason:string; | ||
begin | begin | ||
... | |||
qbe.OutputContainerName := 'MyContainerName'; | |||
qbe.OutputContainerName := ' | |||
qbe.OutputDocumentName := 'wfclassea'; | qbe.OutputDocumentName := 'wfclassea'; | ||
... | |||
end; | end; | ||
</source> | </source> | ||
Ligne 71 : | Ligne 58 : | ||
var qbe:TQueryExecuteTask; doc:TxmlDocument; AStr,AReason:string; | var qbe:TQueryExecuteTask; doc:TxmlDocument; AStr,AReason:string; | ||
begin | begin | ||
... | |||
// @glbUserName will be translated to current user name | // @glbUserName will be translated to current user name | ||
Ligne 83 : | Ligne 64 : | ||
qbe.OutputMailTo := '@glbUserName'; | qbe.OutputMailTo := '@glbUserName'; | ||
... | |||
end; | |||
</source> | |||
'''Export envoyé par email:''' | |||
<source lang="delphi"> | |||
//Procedure Test; | |||
var qbe:TQueryExecuteTask; doc:TxmlDocument; AStr,AReason:string; | |||
begin | |||
... | |||
// Will be send by email using configured smtp service | |||
// | |||
qbe.OutputMailTo := '[email protected]'; | |||
qbe.OutputMailBody := 'This is an export of ... from Sage FRP 1000'; | |||
... | |||
end; | end; | ||
</source> | </source> | ||
Voir aussi: | Voir aussi: |
Dernière version du 15 janvier 2020 à 07:16
<source lang='delphi'>function Execute(var aReason:string):boolean</source>
Cette méthode exécute l'export.
aReason | Raison de l'échec |
Return | True si l'export c'est exécuté |
Exemple :
Export dans un fichier:
<source lang="delphi"> //Procedure Test; var qbe:TQueryExecuteTask; doc:TxmlDocument; AStr,AReason:string; begin
qbe := TQueryExecuteTask.Create;
doc := CreateDescriptor(); AStr := doc.SaveToString;
// This will recreate the document with the correct classes qbe.Descriptor.Document.LoadFromString(AStr);
qbe.OutputFileName := 'c:\temp\exports\wfclassea.csv';
if not qbe.canExecute then raise Exception.Create('cant execute');
if qbe.Execute(aReason) then showMessage('execute OK') else showMessage('execute NOK '+aReason)
end; </source>
Export dans un containeur:
<source lang="delphi"> //Procedure Test; var qbe:TQueryExecuteTask; doc:TxmlDocument; AStr,AReason:string; begin
... qbe.OutputContainerName := 'MyContainerName'; qbe.OutputDocumentName := 'wfclassea'; ...
end; </source>
Export dans une boîte à message:
<source lang="delphi"> //Procedure Test; var qbe:TQueryExecuteTask; doc:TxmlDocument; AStr,AReason:string; begin
...
// @glbUserName will be translated to current user name // qbe.OutputMailTo := '@glbUserName';
...
end; </source>
Export envoyé par email:
<source lang="delphi"> //Procedure Test; var qbe:TQueryExecuteTask; doc:TxmlDocument; AStr,AReason:string; begin
...
// Will be send by email using configured smtp service // qbe.OutputMailTo := '[email protected]'; qbe.OutputMailBody := 'This is an export of ... from Sage FRP 1000';
...
end; </source>
Voir aussi:
{{#if:TQueryExecuteTask_(class)|
{{#if:TQueryExecuteTask_(class)|— TQueryExecuteTask_(class) |}} — Développement DSM —
|
{{#if:|— [[{{{1}}}]] |}} — Développement DSM —
}}