BookmarkSubscribeRSS Feed
vilkis
Calcite | Level 5
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
3 REPLIES 3
Cynthia_sas
Diamond | Level 26
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]
vilkis
Calcite | Level 5
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
Cynthia_sas
Diamond | Level 26
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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 3 replies
  • 1174 views
  • 0 likes
  • 2 in conversation