IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

ODS et reporting Discussion :

Obtention d'un template specifique en rtf


Sujet :

ODS et reporting

  1. #1
    Membre chevronné
    Homme Profil pro
    Biostatisticien
    Inscrit en
    Juin 2009
    Messages
    1 206
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Irlande

    Informations professionnelles :
    Activité : Biostatisticien
    Secteur : Industrie Pharmaceutique

    Informations forums :
    Inscription : Juin 2009
    Messages : 1 206
    Points : 1 868
    Points
    1 868
    Par défaut Obtention d'un template specifique en rtf
    Salut a tous,

    Je dois obenir une sortie specifique, cf piece jointe.Au final, il y aura plusieurs pages, une par categorie.

    Pour l'obtention des QQ plot, pas de soucis, une proc univariate suivi d'une Greplay et le tour est joue.

    Je me casse plus les dents sur l'inclusion des cellulles au dessus (category 1) et en dessous... Sachant que je dois avoir une sortie RTF, on peux abandonner l'ods region. Avez vous une idee pour faire cela? J'ai essaye de bricoler un truc avec titres et footnote mais c'est pas terrible..

    Deuxieme question, savez vous comment redimmensionner la taille du rectangle en sortie pour qu'il soit exactement aux dimensions de l'attache, sans retirer les graphes?

    Merci d'avance a tous ceux qui vont m'aider.

    Manoutz

    mon code pour base de depart:

    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
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    %macro QQPLOT(wk=,group=, in=, var=, titlenb=);
    %if &titlenb=1 %then %do;
    PROC UNIVARIATE DATA=&in.(where=(week=&wk. and grp in (%cmpres("&group.")))) noprint;
    	VAR &var.; 
    	QQPLOT &var./ name="st%sysfunc(substr(&group.,6))wk&wk." nohlabel novlabel;
    	TITLE "&wk. Week" justify=left;
    	TITLE2 "Normal probability plot" ;
    	FOOTNOTE "&group." height=30 in ;
    RUN;
    %end;
    %else %do;
    	PROC UNIVARIATE DATA=&in.(where=(week=&wk. and grp in (%cmpres("&group.")))) noprint;
    		VAR &var.; 
    		QQPLOT &var./ name="st%sysfunc(substr(&group.,6))wk&wk." nohlabel novlabel;
    		FOOTNOTE "&group." height=30 in ;
    		TITLE " ";
    		TITLE2 "Normal probability plot" ;
    	RUN;
    %end;
     
    %mend QQPLOT;
     
     
    %macro week1and2;
    %do i=1 %to 2;
    goptions device=gif gsfname=nesug%cmpres(&i.);
    filename nesug%cmpres(&i.) "H:\Week%cmpres(&i.).gif";
    proc greplay tc=work.tempcat  nofs;
    tdef newtemp des='Three panel template'
    1/ulx=1 uly=75
    urx=33 ury=75
    llx=1 lly=25
    lrx=33 lry=25
    2/ulx=34 uly=75
    urx=66 ury=75
    llx=34 lly=25
    lrx=66 lry=25
    3/ulx=66 uly=75
    urx=99 ury=75
    llx=66 lly=25
    lrx=99 lry=25
    ;
    **************************************************************************
    Above makes the template, below uses it;
    template newtemp;
    igout work.gseg;
    gout work.gseg;
    treplay
    1:st002wk%cmpres(&i.)
    2:st003wk%cmpres(&i.)
    3:st003wk%cmpres(&i.)
    name="Week%cmpres(&i.)";
    quit;
    %end;
    %mend;
     
    %macro week3and4;
    %do i=3 %to 4;
    goptions device=gif gsfname=nesug%cmpres(&i.);
    filename nesug%cmpres(&i.) "H:\Week%cmpres(&i.).gif";
    proc greplay tc=work.tempcat  nofs;
    tdef newtemp des='Two panel template'
    1/ulx=9 uly=75
    urx=42 ury=75
    llx=9 lly=25
    lrx=42 lry=25
    2/ulx=58 uly=75
    urx=91 ury=75
    llx=58 lly=25
    lrx=91 lry=25
    ;
    **************************************************************************
    Above makes the template, below uses it;
    template newtemp;
    igout work.gseg;
    gout work.gseg;
    treplay
    1:st002wk%cmpres(&i.)
    2:st002wk%cmpres(&i.)
    name="Week%cmpres(&i.)";
    quit;
    %end;
    %mend;
    /***********************************************************************/
    /*************                Data Section                **************/
    /***********************************************************************/
     
    proc format;
    	value weeknb
    		1="1 week"
    		2="2 week"
    		3="3 week"
    		4="4 week"
    	;
    quit;
     
     
    %QQPLOT(wk=1,group=gr1,in=VAS,var=vargg, titlenb=1);
    %QQPLOT(wk=2,group=gr1,in=VAS,var=vargg, titlenb=1);
    %QQPLOT(wk=3,group=gr1,in=VAS,var=vargg, titlenb=1);
    %QQPLOT(wk=4,group=gr1,in=VAS,var=vargg, titlenb=1);
     
    %QQPLOT(wk=1,group=gr2,in=VAS,var=vargg, titlenb=0);
    %QQPLOT(wk=2,group=gr2,in=VAS,var=vargg, titlenb=0);
     
    /***********************************************************************/
    /*************                Report Section              **************/
    /***********************************************************************/
    options orientation= landscape ;
     
    %week1and2;
    %week3and4;
     
     
    options noxsync noxwait xmin; *Important options to set when
    using DDE;
    filename wordsys dde "winword|system"; *Set up the
    conversation between Word and SAS;
    *The code below (borrowed from one of the many excellent DDE
    papers by Koen Vyverman) Checks to see if Word is open
    already, and opens it if it is not.;
    data _null_;
    length fid rc start stop time 8;
    fid=fopen('wordsys','s');
    if (fid le 0) then do;
    rc=system('start winword');
    start=datetime();
    stop=start+10;
    do while (fid le 0);
    fid=fopen('wordsys','s');
    time=datetime();
    if (time ge stop) then fid=1;
    end;
    end;
    rc=fclose(fid);
    run;
     
     
     
    data _null_;
    file wordsys;
    put '[FileNewDefault]'; *1) Open a blank Word document. WORD
    must be open already!!;
    put '[Filepagesetup .TopMargin=".02 in" .bottommargin="0.02 in"
    .leftmargin="0.02 in" .rightmargin="0.02 in" ]'; * 2) Fix the Margins;
    put '[Toggleportrait]'; *3) Turn page orientation to landscape;
    put '[InsertPicture "'"H:\Week1.gif"'"]'; 
    put '[InsertPicture "'"H:\Week2.gif"'"]'; 
    put '[InsertPicture "'"H:\Week3.gif"'"]';
    put '[InsertPicture "'"H:\Week4.gif"'"]'; *4) Inserts our graph;
    put '[Editgoto "g"]';
    put '[CharRight 1,1]'; *5a) Selects the Graph;
    put '[Centerpara]'; *5b) Centers it;
    * 6) based on default CGM size (as imported into MS WORD) of
    approximately 3 inches by 4.00 inches this fits perfectly!!;
    put '[FormatPicture .scaleX="100%" .scaleY="100%"]';
    put '[FileSaveAs .Name = "' "H:\graphout.doc" '" .format=0]';
    *Save our new file;
    put '[Fileclose]';*if done;
    run;
    Fichiers attachés Fichiers attachés

Discussions similaires

  1. [SAS 8.2] proc template et ods rtf text - centrer les textes
    Par c_nvy dans le forum ODS et reporting
    Réponses: 11
    Dernier message: 17/12/2009, 18h54
  2. Création templates RTF par les utilisateurs
    Par dubitoph dans le forum Langage
    Réponses: 7
    Dernier message: 05/03/2009, 17h25
  3. Réponses: 6
    Dernier message: 03/09/2008, 18h29
  4. [RTF Template] Utilisation d'un Writer
    Par Gob4 dans le forum Documents
    Réponses: 1
    Dernier message: 30/08/2007, 14h19
  5. Générer RTF avec template
    Par loonies dans le forum Langage
    Réponses: 2
    Dernier message: 28/06/2007, 12h05

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo