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
SAS Super FREQ
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
SAS Super FREQ
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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 720 views
  • 0 likes
  • 2 in conversation