I am trying to create a table of contents and would like to style it as in the picture below. I can get part way there using a PICTURE format on the page number with FILL='.', but am limited to 16 leading periods. Is there a way to get a row to fill all leading/trailing space with periods, or some other way to make a horizontal row of periods?
It seems to me that the issue is the calculation of the number of dots to add, since the font is proportional rather than with a fixed pitch.
Hi,
If you know or can calculate how many periods are required then would the repeat() function be of any help?
Kind regards,
Amir.
How is the table of contents created ?
Are you using ODS PDF option CONTENTS=yes ?
This example generates a TOC with dot fills:
ods _all_ close; ods pdf file='report.pdf' contents=yes ; proc print data=sashelp.class; proc report data=sashelp.class; run; ods pdf close;
Thank you, I know. But I can't find a way to get that ToC to appear after the cover page, and I would need to style it and tag everything appropriately, which would be a lot more work than what I'm doing.
Do you have any working code that comes even reasonably close ? Are you able to share any of it ? What code is being used to create the pdf ? Which procedures ? PRINT/REPORT/TABULATE/SUMMARY/UNIVARIATE/SGPLOT/SPC/GMAP, etc...? ODS TEXT statements? DATA step ODSOUT component objects ? Proc ODSTEXT ?
I'm using ODS PDF to output. My document contains PROC REPORT, PROC TABULATE and PROC SGRENDER. I tried dummying a row of ... into a PROC REPORT by defining a column called 'dots' where I said,
compute dots;
dots = repeat('.', 500);
endcomp;But it didn't like this (threw an error and converted to numeric) and only printed a single dot.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.