GetCounter (QueryExporter)

De Wiki1000
(Différences entre les versions)
(Page créée avec « {{version11}} <source lang='delphi'>function GetCounter(const iName:string):Integer;</source> Cette méthode retourne la valeur d'un compteur. {|class="wikitable" |- !P... »)
 
 
Ligne 16 : Ligne 16 :
 
|Le nom du compteur
 
|Le nom du compteur
 
|}
 
|}
 
  
 
Exemple :
 
Exemple :
 +
 +
'''Utilisation des compteurs:'''
  
 
<source lang="delphi">
 
<source lang="delphi">
 +
 +
//procedure TVueExport.RegleDerivation_EcritureNum;
 +
begin
 +
  Result := 'Counter(P,'+PieceRef+')';
 +
end;
 +
 +
procedure TExportVue.doExport;
 +
begin
 +
  inst := TQueryExporter.Create;
 +
  ...
 +
  inst.SetCounter('P',0);
 +
  ...
 +
  ctn := inst.GetCounter('P');
 +
  inst.Export(TVueExport.CreateSelector(....));
 +
  ctn := inst.GetCounter('P') - ctn;
 +
  ...
 +
end;
 
</source>
 
</source>
 +
 +
<pre>
 +
Vue :
 +
  DatePiece  PieceRef EcritureNum
 +
  01-01-2023 1230    1
 +
  01-01-2023 1230    1
 +
  01-01-2023 1230    1
 +
 
 +
  01-02-2023 1232    2
 +
  01-02-2023 1232    2
 +
  01-02-2023 1232    2
 +
 
 +
  01-03-2023 1231    3
 +
  01-03-2023 1231    3
 +
  ...
 +
</pre>
  
 
Voir aussi :
 
Voir aussi :

Version actuelle en date du 28 novembre 2023 à 12:59

Version11-32x32.png

function GetCounter(const iName:string):Integer;

Cette méthode retourne la valeur d'un compteur.

Paramètre Usage
Result La valeur du compteur
iName Le nom du compteur

Exemple :

Utilisation des compteurs:

//procedure TVueExport.RegleDerivation_EcritureNum;
begin
  Result := 'Counter(P,'+PieceRef+')';
end;
 
procedure TExportVue.doExport;
begin
  inst := TQueryExporter.Create;
  ...
  inst.SetCounter('P',0);
  ...
  ctn := inst.GetCounter('P');
  inst.Export(TVueExport.CreateSelector(....));
  ctn := inst.GetCounter('P') - ctn;
  ...
end;
Vue :
  DatePiece  PieceRef EcritureNum
  01-01-2023 1230     1 
  01-01-2023 1230     1
  01-01-2023 1230     1
  
  01-02-2023 1232     2
  01-02-2023 1232     2 
  01-02-2023 1232     2
  
  01-03-2023 1231     3
  01-03-2023 1231     3
  ... 

Voir aussi :

QueryExporter (tech)Développement DSM





Whos here now:   Members 0   Guests 0   Bots & Crawlers 1
 
Outils personnels