Hello,
I have three questions about the PDF bookmarks generated by RWI table.
I created a sample below. Thanks in advance!
ods pdf file="test.pdf";
title1 j=c "Sample of Class";
ods proclabel="Bookmark 1";
proc sort data=sashelp.class out=class;
by sex;
run;
data _null_;
set class end=eof;
by sex;
if _N_ = 1 then do;
dcl odsout o();
end;
if first.sex then do;
if SEX = 'F' then do;
o.table_start(label: 'Sex=F, keep it in bookmark');
end;
else do;
o.table_start(label: "Sex=M, don't show in bookmark");
end;
end;
o.row_start();
o.format_cell(data: Name ||' ' ||SEX);
o.row_end();
if last.sex then do;
o.table_end();
end;
if eof then do;
o.table_end();
end;
run;
ods proclabel="Can I move the following bookmarks under Bookmark 1?";
data _null_;
set class end=eof;
by sex;
if _N_ = 1 then do;
dcl odsout o();
end;
if first.sex then do;
if SEX = 'F' then do;
o.table_start(label: 'Sex=F, keep it in bookmark');
end;
else do;
o.table_start(label: "Sex=M, don't show in bookmark");
end;
end;
o.row_start();
o.format_cell(data: Name ||' ' ||SEX);
o.row_end();
if last.sex then do;
o.table_end();
end;
if eof then do;
o.table_end();
end;
run;
ods pdf close;
ods listing;
The original bookmark of sample as
The bookmarks sample if the question 1 can be solved
The sample bookmark after question 2 be solved.
And finally the bookmark looks like
Have you tried using Java Script functions?
Thank you!
I noticed that paper. I can modify the bookmark using js, ghostscript or other tools after the PDF is created. However, I want to find if it can be down in SAS itself other than through third party solution because my PDF generated through SAS intrnet.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.