The SAS Output Delivery System and reporting techniques

Modify style of the page of table of content and add a header (PDF)

Reply
New Contributor
Posts: 4

Modify style of the page of table of content and add a header (PDF)

Hello,
Is it possible to change style of automatically generated table of content (proc report to pdf) and to add a header as it is absent on this page (or custom text before content). If it is, please, give a hint.
Regards,
vilkis
SAS Super FREQ
Posts: 8,743

Re: Modify style of the page of table of content and add a header (PDF)

Hi:
I am not sure what you mean by "Header" ... when I run Example 1 below, I see the string 'Table of Contents' at the top of my PDF contents page. If you run Example 1 and do NOT see 'Table of Contents' at the top of the page, then you should work with Tech Support.

In Example 2, I create a new style template based on STYLES.PRINTER and change the Content Title style attribute of the TEXT element to something silly, like "Wombat". Then, when I use the new template, I see the new string in the PDF output -- at the top of the contents information.

cynthia
[pre]
** 1) header is "Table of Contents";
ods pdf file='c:\temp\toc.pdf' contents=on;

proc print data=sashelp.class;
run;

proc freq data=sashelp.class;
tables age;
run;
ods pdf close;

ods path work.tmp(update) sasuser.templat(update)
sashelp.tmplmst(read);

proc template;
define style styles.chgtoc;
parent=styles.printer;
class text
"Common text." /
'Content Title' = "Wombat";
end;
run;

** 2) Using template Header will be "Wombat";
ods pdf file='c:\temp\chgtoc.pdf' contents=on
style=styles.chgtoc;

proc print data=sashelp.class;
run;

proc freq data=sashelp.class;
tables age;
run;
ods pdf close;
[/pre]
New Contributor
Posts: 4

Re: Modify style of the page of table of content and add a header (PDF)

Thank you. Example 2 is a start. Can I add in such a way some text and a picture above text "Wombat" (Example 2)?
Regards,
vilkis
SAS Super FREQ
Posts: 8,743

Re: Modify style of the page of table of content and add a header (PDF)

Hi:
Not sure. Normally, I would use a title statement to get an image (such as a logo) into a PDF file, but with the contents page, there is no title used on that page. So, that leaves you with a style template change to use PREIMAGE on one of the contents-related style elements.

But, I'm not sure that PREIMAGE is one of the style attributes that you can set in a style template for a Table of Contents page. This would be a question for Tech Support.

cynthia
Ask a Question
Discussion stats
  • 3 replies
  • 174 views
  • 0 likes
  • 2 in conversation