Bonne rencontre,

Je viens d'essayer le champs tableur et j'ai une lenteur d'exécution relativement dissuasive.

J’ai une procédure stocke en MS-SQL qui retourne un résultat en un claquement de doigt (+- 60k lignes).

Quand je stock dans une table, j’ai le résultat presque instantanément.

Quand je le stock dans un champs tableur, il me faut un temps fou. Je ne remplis peut-être pas mon champ tableur de la bonne façon.

Voici mon code :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
 
txtReq est une chaîne = "" 
ChiffrePeriodeInstantTV2 est une Source de Données
nPositionLigne est un entier = 2
 
TableurAjouteDonnée(TBLR_rapport,1,1, "DateChiffre")
TableurAjouteDonnée(TBLR_rapport,2,1, "Chiffre")
TableurAjouteDonnée(TBLR_rapport,3,1, "ChiffreBefore1")
TableurAjouteDonnée(TBLR_rapport,4,1, "PourcentNational")
TableurAjouteDonnée(TBLR_rapport,5,1, "Pax")
TableurAjouteDonnée(TBLR_rapport,6,1, "Segment")
TableurAjouteDonnée(TBLR_rapport,7,1, "PaxBefore1")
TableurAjouteDonnée(TBLR_rapport,8,1, "SegmentBefore1")
TableurAjouteDonnée(TBLR_rapport,9,1, "NomAgence")
TableurAjouteDonnée(TBLR_rapport,10,1, "Matricule")
TableurAjouteDonnée(TBLR_rapport,11,1, "NomTo")
TableurAjouteDonnée(TBLR_rapport,12,1, "NomSecteur")
TableurAjouteDonnée(TBLR_rapport,13,1, "OrdreTo")
TableurAjouteDonnée(TBLR_rapport,14,1, "Parite")
TableurAjouteDonnée(TBLR_rapport,15,1, "SaisiLe")
TableurAjouteDonnée(TBLR_rapport,16,1, "SaisiPar")
TableurAjouteDonnée(TBLR_rapport,17,1, "ModifierLe")
TableurAjouteDonnée(TBLR_rapport,18,1, "ModifierPar")
TableurAjouteDonnée(TBLR_rapport,19,1, "IDAgence")
TableurAjouteDonnée(TBLR_rapport,20,1, "IDTourOperateur")
TableurAjouteDonnée(TBLR_rapport,21,1, "IDSecteur")
 
JAUGE_progression..BorneMin = 0
JAUGE_progression = 0
 
txtReq = "EXEC [dbo].[User_ChiffrePeriodeInstantTV2] ;"
 
SI HExécuteRequêteSQL(ChiffrePeriodeInstantTV2,"gcnxMaConnexion", ...
	hRequêteSansCorrection,txtReq) ALORS
	JAUGE_progression..BorneMax = HNbEnr(ChiffrePeriodeInstantTV2)		
	HLitPremier(ChiffrePeriodeInstantTV2)
	TANTQUE PAS HEnDehors(ChiffrePeriodeInstantTV2)
 
		TableurAjouteDonnée(TBLR_rapport,1,nPositionLigne, ChiffrePeriodeInstantTV2.DateChiffre)
		TableurAjouteDonnée(TBLR_rapport,2,nPositionLigne, ChiffrePeriodeInstantTV2.chiffre)
		TableurAjouteDonnée(TBLR_rapport,3,nPositionLigne, ChiffrePeriodeInstantTV2.chiffreBefore1)
		TableurAjouteDonnée(TBLR_rapport,4,nPositionLigne, ChiffrePeriodeInstantTV2.PourcentNational)
		TableurAjouteDonnée(TBLR_rapport,5,nPositionLigne, ChiffrePeriodeInstantTV2.Pax)
		TableurAjouteDonnée(TBLR_rapport,6,nPositionLigne, ChiffrePeriodeInstantTV2.Segment)
		TableurAjouteDonnée(TBLR_rapport,7,nPositionLigne, ChiffrePeriodeInstantTV2.PaxBefore1)
		TableurAjouteDonnée(TBLR_rapport,8,nPositionLigne, ChiffrePeriodeInstantTV2.SegmentBefore1)
		TableurAjouteDonnée(TBLR_rapport,9,nPositionLigne, ChiffrePeriodeInstantTV2.NomAgence)
		TableurAjouteDonnée(TBLR_rapport,10,nPositionLigne, ChiffrePeriodeInstantTV2.Matricule)
		TableurAjouteDonnée(TBLR_rapport,11,nPositionLigne, ChiffrePeriodeInstantTV2.NomTo)
		TableurAjouteDonnée(TBLR_rapport,12,nPositionLigne, ChiffrePeriodeInstantTV2.NomSecteur)
		TableurAjouteDonnée(TBLR_rapport,13,nPositionLigne, ChiffrePeriodeInstantTV2.OrdreTo)
		TableurAjouteDonnée(TBLR_rapport,14,nPositionLigne, ChiffrePeriodeInstantTV2.Parite)
		TableurAjouteDonnée(TBLR_rapport,15,nPositionLigne, ChiffrePeriodeInstantTV2.SaisiLe)
		TableurAjouteDonnée(TBLR_rapport,16,nPositionLigne, ChiffrePeriodeInstantTV2.SaisiPar)
		TableurAjouteDonnée(TBLR_rapport,17,nPositionLigne, ChiffrePeriodeInstantTV2.ModifierLe)
		TableurAjouteDonnée(TBLR_rapport,18,nPositionLigne, ChiffrePeriodeInstantTV2.ModifierPar)
		TableurAjouteDonnée(TBLR_rapport,19,nPositionLigne, ChiffrePeriodeInstantTV2.IDAgence)
		TableurAjouteDonnée(TBLR_rapport,20,nPositionLigne, ChiffrePeriodeInstantTV2.IDTourOperateur)
		TableurAjouteDonnée(TBLR_rapport,21,nPositionLigne, ChiffrePeriodeInstantTV2.IDSecteur)
 
		nPositionLigne++
		JAUGE_progression++
		HLitSuivant(ChiffrePeriodeInstantTV2)
	FIN
	HAnnuleDéclaration(ChiffrePeriodeInstantTV2)
SINON
	Erreur(HErreurInfo())	
FIN
 
SI TableurSauve(TBLR_rapport,gsRepertoirerRapport+"\RapportChiffre" + DateDuJour()+".xlsx",tblrEcrasementAutorisé) = Faux ALORS
	Erreur("Fichier non sauvegardé " + ErreurInfo())
SINON
	Info("Fichier sauvegardé")
FIN
D'avance, merci pour votre retour.

Raphaël.