Précédent   Forum des professionnels en informatique > Logiciels > Solutions d'entreprise > Business Intelligence > SAS > ODS et reporting
ODS et reporting Forum d'entraide sur les fonctionnalités de reporting de SAS : gérer les sorties et graphiques de SAS
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 08/12/2011, 18h33   #1
Invité de passage
 
Inscription : novembre 2009
Messages : 13
Détails du profil
Informations forums :
Inscription : novembre 2009
Messages : 13
Points : 1
Points : 1
Par défaut format+macro+ ods TAGSETS.EXCELXP

* Bonjour, *

J’ai un Beug avec un programme que je n’arrive pas à comprendre. J’espère que vous pourrez m’aider.

J’exécute ce programme pour générer une sortie Excel avec une mise en forme conditionnelle :
Code :
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
 
proc format;
value $remise 
"OUI"='lightgreen'
"NON"='lightorange'
"NEA"='lightblue'
" "='lightgrey';
run;
proc template;                                                                
   define style Styles.synthese;                                              
      parent = styles.festival;   
            REPLACE header   /
 
      bordertopcolor = white
      font_face = "Verdana"
      just        = c
           vjust = C;
 
REPLACE DATA FROM COLUMN /
 
      bordertopcolor = CX000000
      borderbottomcolor = CX000000
      borderrightcolor = CX000000
      borderleftcolor =CX000000;
 
   end;                                                                       
run;                                                                         
 
 
options nocenter nonotes ;
ods listing close;
ODS TAGSETS.EXCELXP 
options
(sheet_name='essaie'
embedded_titles='Yes'
absolute_column_width='6,25,6,6,6,6,6'  
embedded_footnotes='Yes' 
width_fudge='1.05')
path ="&rep.\mise_en_forme"
FILE = "essai.xls" 
style=synthese;
title ;
PROC report  DATA = test.synthese nowd;
define CIB/  center display style(COLUMN)=[tagattr='format:@'   FONT_WEIGHT=BOLD font_face="Verdana"];
 
define DENOMINATION/ display  "DENOMINATION" style(COLUMN)=[ font_face="MS Sans Serif" font_size = 10pt];
 
define SMF/center  display  style(COLUMN)=[ font_face="MS Sans Serif" font_size = 10pt];
 
define M_INTDEPO/ center display style(COLUMN)=[background=$remise.  font_face="MS Sans Serif" font_size = 10pt];
 
 
define M_INTENCO/ center display style(COLUMN)=[background=$remise. font_face="MS Sans Serif" font_size = 10pt];
 
define M_INTNOUA/ center display style(COLUMN)=[background=$remise. font_face="MS Sans Serif" font_size = 10pt];
 
define M_INTNOUG/ center display style(COLUMN)=[background=$remise. font_face="MS Sans Serif" font_size = 10pt];
 
RUN ;
ODS TAGSETS.EXCELXP CLOSE ;
Tout se passe bien et j’ai ma sortie EXCEL avec la mise en forme que je souhaite. Là ou ça se complique c’est quand je passe à automatiser le programme :

Code :
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
 
 
%macro essai;
proc format;
value $remise 
"OUI"='lightgreen'
"NON"='lightorange'
"NEA"='lightblue'
" "='lightgrey';
run;
proc template;                                                                
   define style Styles.synthese;                                              
      parent = styles.festival;   
            REPLACE header   /
 
      bordertopcolor = white
      font_face = "Verdana"
     just        = c
     vjust = C;
      REPLACE DATA FROM COLUMN /
 
      bordertopcolor = CX000000
      borderbottomcolor = CX000000
      borderrightcolor = CX000000
      borderleftcolor =CX000000;
 
   end;                                                                       
run;  
options nocenter nonotes ;
ods listing close;
ODS TAGSETS.EXCELXP 
options
(sheet_name="feuille"
embedded_titles='Yes'
absolute_column_width='6,25,6,6,6,6,6,6,6,6,6,6,6,6,6'  
embedded_footnotes='Yes' 
width_fudge='1.01')
FILE = "&rep./test1.xls" 
style=synthese;
title ;
PROC report  DATA = S2_SYNTHESE3 nowd;
define CIB/  center display style(COLUMN)=[tagattr='format:@'   FONT_WEIGHT=BOLD font_face="Verdana"];
 
define DENOMINATION/ display  "DENOMINATION"  style(COLUMN)=[ font_face="MS Sans Serif" font_size = 10pt];
 
define SMF/center  display  style(COLUMN)=[ font_face="MS Sans Serif" font_size = 10pt];
 
 
 
%Do nbre_col=1 %TO &nbre_tableau;
define &&tableau&nbre_col. /center display style(COLUMN)=[background=$remise.  font_face="MS Sans Serif" font_size = 10pt];
 
%end;
 
RUN ;
ODS TAGSETS.EXCELXP CLOSE ;
%mend essai;
 
%essai;
Il n’y a aucune erreur dans la log mais quand j’ouvre mon fichier EXCEL voici la surprise :
une fenêtre indique un problème de chargement dans le domaine suivant style
Impossible d'ouvrir ce fichier en raison d'erreurs. les erreurs sont répertoriées dans .........
Après plusieurs essais je sais que le problème vient de style(column)=[background=$remise.]. Car quand je le retire tout se passe bien.

Sans la direction ods tagsets le résultat est bon aussi.

Mais le mélange format+macro+ tagset ne marche pas. Il y a quelque chose qui m’échappe.

D’avance Merci,

Chiraz.
chiraz01 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 12/12/2011, 11h40   #2
Membre régulier
 
Inscription : novembre 2009
Messages : 77
Détails du profil
Informations forums :
Inscription : novembre 2009
Messages : 77
Points : 75
Points : 75
Citation:
Envoyé par chiraz01 Voir le message
J’ai un Beug avec un programme que je n’arrive pas à comprendre. J’espère que vous pourrez m’aider.
PROC report DATA = test.synthese nowd;
le mélange format+macro+ tagset ne marche pas. Il y a quelque chose qui m’échappe.
D’avance Merci,
Chiraz.
Change ton code pour utiliser sashelp.class au lieu de test.synthese pour qu'on puisse tester chez nous et t'aider.
frfancha est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 01h06.


 
 
 
 
Partenaires

Hébergement Web