The SAS Output Delivery System and reporting techniques

How to manage content with proc report including graphs

Accepted Solution Solved
Reply
Highlighted
Contributor
Posts: 28
Accepted Solution

How to manage content with proc report including graphs

Dear all,

I try to create a report (doc) with tables and graphs but when i include a graph with proc report, line table appears in content (see line in red):

Contents.png

Please find my code below

ods rtf file='\\vcarapp010\Rapports\01 - Pivotal study\Report\ReportForAllPatients\SixMinWalktest_CPX_Test_Report.doc' dpi=300 contents=yes toc_data;
ods noproctitle;
ods escapechar='~';
footnote1 j=left "~S={preimage='\\vcarapp010\Rapports\03 - MATERIALS FOR REPORT\Logocarmat2.JPG'}" j=r 'Page ~{thispage}';/*/~{lastpage}*/


ods proclabel 'Chapter 1: Six minutes Walkin test ';
proc report data= sixminuteWalkingTest2 nowd CONTENTS='Table 1.1 - Six minutes walking Test - Distance'; 
column INDEX Patient_Code preOp_value m1_value m2_value m3_value;
define index / group noprint;
break before index/ contents="" page;
define Patient_Code / style={cellwidth=15%} "Patient";
define preOp_value / style={cellwidth=10%} "Pre-Op";
define m1_value / style={cellwidth=10%} "M1";
define m2_value / style={cellwidth=10%} "M2";
define m3_value / style={cellwidth=10%} "M3";
title1 "Study Code: CAR2016-01 / Date: &SYSDATE.";
title2 'Table 1.1 - Six minutes walking Test - Distance'; 
run;



data pt1;
set sixminuteWalkingTest2;
run;

proc sort data=pt1;
by index;
run;

data pt1;
set pt1;
by index;
if last.index;
keep index;
run;


data fmt;
   set pt1;
   fmtname = "mypic";
   start =1;
   label = "\\vcarapp010\Rapports\01 - Pivotal study\Graphs\Histo_SixMinWalk.png";
   keep fmtname label start;
run;

/* Create the format containing the links to the images. */
proc format cntlin=fmt;
run;

/* Create a format to blank out values in the column that will contain the image. */
proc format;
   value blank other=" ";
run;

ods listing close;

data pt1;
set pt1;
index=1;
run;
ods rtf startpage=No;  /*pour avoir un saut de page */
ods proclabel '  ';

proc report data=pt1 nowd CONTENTS="Graph 1.2: Six minutes walking test Histogram"
 style(report)={background=white}
  style(header)={foreground=black background=white height=0}
  style(column)={just=right};
   column index ('' image);
   define index / group noprint;
   break before index/ contents="" ;
   define image/ '' computed style(column)=[postimage=mypic. just=l cellwidth=7.0 in ] format=blank.;

   /* Set the computed variable equal to the variable */
   /* value that matches the value in the $Mypic. format. */
   compute image ;
      image = 1;
   endcomp;
title1 "Study Code: CAR2016-01 / Date: &SYSDATE.";
title2 "Graph 1.2: Six minutes walking test Histogram"; 
run;

Thanks for you help,

 

 


Accepted Solutions
Solution
a week ago
SAS Super FREQ
Posts: 9,039

Re: How to manage content with proc report including graphs

Hi:
  I am not sure why you are using PROC REPORT for a HISTOGRAM however, the extra TABLE1 node is a known PROC REPORT "feature" and there are ways to get rid of it, as described in this Tech Support note: http://support.sas.com/kb/31/278.html .

cynthia

View solution in original post


All Replies
Super User
Posts: 10,323

Re: How to manage content with proc report including graphs

Try add one option.

 

proc report data=sashelp.class nowd contents='';
Contributor
Posts: 28

Re: How to manage content with proc report including graphs

Thank for you answer,

like this?:

proc report data=pt1 nowd contents=''
 style(report)={background=white}
  style(header)={foreground=black background=white height=0}
  style(column)={just=right};
   column index ('' image);
   define index / group noprint;
   break before index/ contents="" ;
   define image/ '' computed style(column)=[postimage=mypic. just=l cellwidth=7.0 in ] format=blank.;

   /* Set the computed variable equal to the variable */
   /* value that matches the value in the $Mypic. format. */
   compute image ;
      image = 1;
   endcomp;
title1 "Study Code: CAR2016-01 / Date: &SYSDATE.";
title2 "Graph 1.2: Six minutes walking test Histogram"; 
run;

But I lose true title of chapter and table 1 is still there.

Solution
a week ago
SAS Super FREQ
Posts: 9,039

Re: How to manage content with proc report including graphs

Hi:
  I am not sure why you are using PROC REPORT for a HISTOGRAM however, the extra TABLE1 node is a known PROC REPORT "feature" and there are ways to get rid of it, as described in this Tech Support note: http://support.sas.com/kb/31/278.html .

cynthia

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 102 views
  • 0 likes
  • 3 in conversation