The SAS Output Delivery System and reporting techniques

Can I Remove a first-level node in PDF bookmarks?

Reply
Occasional Contributor
Posts: 9

Can I Remove a first-level node in PDF bookmarks?

Hi everyone,

For example I have the following code:

Ods Pdf File = "temp.pdf";

Ods Proclabel Contents = "temp1_1stnode";

Proc Report Data = temp1 Contents = "temp1_2ndnode";

  Title "temp1";

Run;

Ods Proclabel Contents = "temp2_1stnode";

Proc Report Data = temp2 Contents = "temp2_2ndnode";

  Title "temp2";

Run;

Ods Pdf Close;

*************************************************************************************

I leanred that by wrting "Contents = "" " in an individual proc report statement, I can suprress the 2nd-level node in the pdf bookmark for that report.  Is there a way to remove the first-level node (consequencely remove the second-level node) for just one report? So in the PDF bookmark, I only see the nodes for one report.

Another separate question, when I click a node in the bookmark, the PDF directs me to the report table. But if I don't scroll the screen I can't see the title of that table. Is it possible to link the node to the title instead?

Thanks in advance for any suggestions.

SAS Super FREQ
Posts: 8,818

Re: Can I Remove a first-level node in PDF bookmarks?

Hi:

  As far as I know, the only way to "collapse" down to 1 single node is to use ODS DOCUMENT/PROC DOCUMENT for manipulating the table of contents. I am not exactly sure what you mean when you ask:

" Is there a way to remove the first-level node (consequencely remove the second-level node) for just one report?"

  You can rename the top level node or set it to be space, but that does not automatically remove the secondary node, just as you can remove the secondary node without removing the first node or the third node. The nodes in the TOC are essentially independent of each other. That's why the only way to really restructure your nodes is with ODS DOCUMENT/PROC DOCUMENT.

  Your ODS PROCLABEL statement is incorrect. It should be:

Ods Proclabel "temp1_1stnode"; (NO Contents= in the PROCLABEL statement),

but, without working code to run, it looks to me like your code will produce the following TOC (with -- for indents):

-temp1_1stnode

---temp1_2ndnode

------Table 1

-temp2_1stnode

---temp2_2ndnode

------Table 1

So, of the 3 nodes for each REPORT step, what do you want to see? Removing temp1_1stnode will not remove the 2nd level or 3rd level node.  Also remember that only PRINT, REPORT, TABULATE and PROC FREQ multi-way tables have the CONTENTS= ability. Mostly with the other procedures, you have the ODS PROCLABEL capability and that's it.

cynthia

(This paper shows how to rearrange and restructure the TOC completely http://support.sas.com/resources/papers/sgf09/318-2009.pdf )

Occasional Contributor
Posts: 9

Re: Can I Remove a first-level node in PDF bookmarks?

Hi Cynthia,

Thanks very much for your fast reply on Friday, though I haven't got a chance of reading it until now.

What I want to see is:

-temp2_1stnode

---temp2_2ndnode

------Table 1

That is, only nodes for report 2 in the bookmark. Can this only be achieved by Proc Document?

************************************************************************************************************

The 2nd question I'd like to ask is:

If I click "temp2_1stnode" in the book mark, the Adobe Reader link it to the body of the report 2, but not the title. For example, my report 2 in the pdf looks like:

                                                       Temp2 Title is Here

         ___________________________________________________________________

         ----------------------------------------------------------------------------------------------------------------

         |                Temp2 Body is Here,  Temp2 Body is Here, Temp2 Body is Here             |

         |                Temp2 Body is Here,  Temp2 Body is Here, Temp2 Body is Here             |

         ___________________________________________________________________

If I l click the node,  the pdf will more to the position where I can only see the body, but not the title. I need to scroll up a little bit to see the title.

Is there a way to "Fix" this?

Thank you very much                                                                                             

SAS Super FREQ
Posts: 8,818

Re: Can I Remove a first-level node in PDF bookmarks?

Hi:

  I am confused -- what would happen to the 1st PROC REPORT output? Are you deleting it entirely from your output? Or, are you moving it -under- the temp2_1stnode?  I do not know whether you can remove a node entirely but still leave the report in the document -- if that is what you want. That would be a question for Tech Support. I do know that you can selectively turn the BOOKMARKGEN option on and off between procedures. So if what you want is to have nothing in the bookmarks for the 1st PROC REPORT and then something in the bookmarks for the 2nd PROC REPORT, that is possible. See the code below. If this is NOT what you mean, then you'd have to work with Tech Support.

  As for your 2nd question, if I am in "page" view mode in Acrobat Reader, when I click the bookmark, I see the whole page, including the title and then I can zoom in as I choose. If I am in "width" mode in Acrobat Reader, then when I click the bookmark, I see what you observe (that the bookmark takes me to the top of the table of output), not to the top of the page. I believe that the bookmark is attached to the beginning of the table, not to the beginning of the page. Since you can change or delete or replace the SAS title in the document (using OB... commands), I am not sure that you can set a bookmark for a title. Nor am I sure that this is something that can be fixed with SAS commands. Perhaps if you had the full Adobe Acrobat, you can "reset" the bookmarks, but as SAS sets them, I believe they belong to the table. This would be another question for Tech Support.

cynthia

ods _all_ close;

ods pdf file='c:\temp\no_1st_node_report.pdf'

    bookmarkgen=no bookmarklist=show;

 

ods proclabel 'temp1_1stnode';

proc report data=sashelp.class nowd contents='temp1_2ndnode';

title 'Title1';

run;

ods pdf bookmarkgen=yes bookmarklist=show;

ods proclabel 'temp2_1stnode';

proc report data=sashelp.cars(obs=10) nowd contents='temp2_2ndnode';

title 'Title2';

column Make Model Type Origin DriveTrain MSRP Invoice;

compute before _page_;

  line 'Table Caption for Report 2 temp2_1stnode';

endcomp;

run;

ods pdf close;

Occasional Contributor
Posts: 9

Re: Can I Remove a first-level node in PDF bookmarks?

Thank you, Cynthia,

I think "Bookmarkgen = No" is what I want to suppress all the bookmarks for the 1st report.

For the title issue, I think I will live it for now and contact the Tech Support later.

Thanks again for all your input.

Ask a Question
Discussion stats
  • 4 replies
  • 1773 views
  • 3 likes
  • 2 in conversation