DATA Step, Macro, Functions and more

How to generate RTF report using template

Posts: 0

How to generate RTF report using template


My question is how to generate report using predefined template and places where appropriate charts and tables generated with SAS should be placed. I searched lots in the google but unfortunately all the samples was ho to generate RTF using some standardization like font size, colors, etc. But the main my aim is to have a possibility to change some explanatory text near the charts or tables which are generated runing SAS procedures.

Thanks in advance!
Posts: 8,742

Re: How to generate RTF report using template

I'm not entirely sure what you mean by a "template" -- a Word .dot file??? With SAS, the term "template" can mean several different things -- you can have a SAS/GRAPH template for use with PROC GREPLAY; there are ODS templates -- table, style, tagset and graph templates; you can have report templates in Web Report Studio or task templates in SAS Enterprise Guide (this is new).

One thing I've done is create a CSV file of data points or variable information and then use the Word mail/merge capability to create the same document for every Region or every BY group, for example -- by using my CSV file as input to the mail merge. This does mean that you have to design the Word document ahead of time and you have to know what the field codes are that Word is expecting to find in the CSV file.

Specifically, to change explanatory text for charts or documents, you might want to investigate the use of ODS RTF TEXT= (for SAS 9.1.3) or ODS TEXT= (for SAS 9.2). The TEXT= option allows you to insert text before and/or after procedures in order to send a simple caption or a paragraph of explanatory text into your ODS RTF result file. When you combine this option with SAS macro variables, you have a very flexible way to insert explanatory text into ODS output files.

Posts: 0

Re: How to generate RTF report using template

Thanks for the answer.

"Template" I ment that I have already prebuilded RTF file where i putted special keys and after charts and tables preparation those keys should be replaced by respective charts or tables.
Posts: 30

Re: How to generate RTF report using template

Hi berniunas

I think you are after some thing like in the paper below. Although I have used XML and HTML I have not tried RTF, but it should be the same in principle. You might have to refer to

RTF Pocket Guide: (Sean M. Burke)

for graphics.

Ask a Question
Discussion stats
  • 3 replies
  • 3 in conversation