ODS and Base Reporting

Build reports by using ODS to create HTML, PDF, RTF, Excel, text reports and more!
BookmarkSubscribeRSS Feed
SASdevAnneMarie
Barite | Level 11

Hello everyone!

 

 

I would like that  wide report  (9 columns) fit in landscape orientation. I use this code.

Unfortunately I have the message that word can be open.

Could you help me please?

 

Thank you very much! 

 

 

 

option papersize=a3;
option nomprint nosymbolgen nomlogic nodate nonumber missing=0
orientation=portrait nocenter
topmargin=.15in
bottommargin=.15in
leftmargin=.15in rightmargin=.15in ;

 

ods word file="&Output\3. Publipostage\TEST\Loi.docx";


proc report data=tab_30 nowd
style(report)=[rules=groups frame = hsides background =white bordercolor=purple frame=void rules=none cellpadding=0 cellspacing=.15pt]
style(header)=[background = white font_size=8pt font_face = 'narrow' cellpadding=0 cellspacing=.15pt]
style(column)=[font_size = 8pt font_face='narrow' cellspacing=0 cellwidth = 2.5 cm cellpadding=0 cellspacing=.15pt ];
column Code_ISIN Nom_support "Société de gestion"n "Performance brute de l'actif N-1"n "Frais de gestion de l'actif"n "Performance nette de l'UC"n "Frais de gestion du contrat"n "Performance finale"n "Taux de rétrocessions de comm"n;
run;


ods word close;

8 REPLIES 8
SASdevAnneMarie
Barite | Level 11
I mean that this cod works when I report only 4 columns, it does not work for 9 columns 😞
Ksharp
Super User

Did you try

options orientation=landscape ;

 

SASdevAnneMarie
Barite | Level 11

yes, same problem 😞

Cynthia_sas
SAS Super FREQ

Hi:

  Remember that ODS WORD is pre-production. So you might want to try ODS RTF first. Then if you have working code for ODS RTF and ODS WORD does not work as expected, then you should open a track with Tech Support so they can verify your experience and confirm that it is not your data causing an issue. They'll check your specific version of SAS and be able to tell you whether this is something that is due to the pre-production status of ODS WORD or whether there is something else you can do. I would expect you'll find that your issue is due to a pre-production glitch either related to the style or the rendering or something internal. I tend to avoid pre-production features until they become production.

 

  When I run THIS simplified version of your code in SAS 9.4M5 and M6 using ODS RTF, I can get 16 columns on the report. Note that I simplified the code by taking out the style(column) width and other settings and just let ODS RTF figure the column size and used the default font from the RTF style. Here's the code:

options papersize=a3 orientation=landscape nocenter
        nomprint nosymbolgen nomlogic nodate nonumber missing=0
        topmargin=.15in bottommargin=.15in
        leftmargin=.15in rightmargin=.15in ;
  
 
ods rtf file="c:\temp\output\Loi_or.rtf";
 
proc report data=sashelp.class nowd
style(report)=[rules=groups frame=hsides width=100%
              bordercolor=purple borderwidth=2pt
              cellpadding=3px cellspacing=4px]
style(header)=[font_size=9pt just=c]
style(column)=[font_size=9pt just=c];
column ('Should be 16 cols' 
        name sex age height weight 
        sex age height weight 
        sex age height weight
        name sex age);
run;
 
ods rtf close;

 

I also cleaned up the STYLE(REPORT) section to use the FRAME=HSIDES and the BORDERCOLOR of purple. and the output opened in Word:

use_rtf_default_style.png

Hope this helps. I encourage you to open a track with Tech Support to ask about ODS WORD and the behavior you're observing.

 

Cynthia

SASdevAnneMarie
Barite | Level 11

Thank you Cynthia,

 

Yes, ods rtf works well!

Do you know the contact of Tech Support SAS?

 

Best regards,

Marie

Cynthia_sas
SAS Super FREQ

Hi:

  You can fill out this form: http://support.sas.com/ctx/supportform/createForm to open a track.

Cynthia

SASdevAnneMarie
Barite | Level 11

Thank you! 

Jianmin
Obsidian | Level 7

Hi MarieT and Cynthia, 

 

Good question and testing on new ODS WORD.  A lot of things can go wrong when an RTF file does not open.  Sometimes it's your input data.  For example, if you have a long string characters with unpaired {} or some other strange character that causes some other character lost. 

 

Does anyone know how many columns SAS ODS RTF proc report support?  Older version of Word supports 31, and the new Word supports 63.  See the attached. 

 

Best Regards 

Jianmin Long

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 8 replies
  • 2039 views
  • 0 likes
  • 4 in conversation