SSRS - Creating Bookmarks in a PDF using the object property : Document Map Label

I did not see much in the data here regarding this particular topic, so I felt like adding it for posterity sake just in case someone like me finds themselves looking for this information in the future.

Creating Bookmarks in a PDF using SSRS
11/19/2020

PROBLEM DEFINITION
One of the neat features in the Crystal Report Viewer was that the navigation pane was efficient for user navigation.
It was well in tune with the document data and a user could easily navigate the document just by mousing as opposed to using a keyboarded full document search operation.
This report preview was quite useful, as one user reported, for
traversing a Job Traveler Report.

● Job Traveler Report
○ Jobs, job operations, subassemblies, subassembly job operations.
○ Subreports: Raw Materials. Subassembly Components.
○ Many assembly numbers, operations, and parts.

Since the direction of Epicor now is to move away from Crystal Reports, we took the opportunity when reasonable to go ahead and convert many of the custom reports over to SSRS. The Job Traveler was one of those reports. Unfortunately, the out of the box SSRS report does not give you the right kind of information populated in the navigation pane of the resulting PDF document when using report preview.

This problem bridges into the area of “Accessibility” as I found out when researching solutions. “Accessibility” encourages us to always tag, caption, alt-text, and those kinds of things when doing our development work. It is worthwhile for many reasons. Notice how the standard report just gives you Bookmarks pinned to all the Job Operations for each Assembly, and it is not really that useful.

PROPOSED SOLUTION
In my research I kept running across the concept of Tags in the PDF specification. In fact, Adobe Reader is supposed to automatically Tag a document when it is opened, but I could not find any evidence of this, except for the Property Yes/No this document is a Tagged PDF. I never saw Tags as part of the navigation pane. If you are using Acrobat Pro DC or something equivalent, there are features there to create Tagging, but in the case of an ERP system generating the PDFs for us, that is not a robust option.

Navigation Pane Bookmarks
Enter the Bookmark and this article on Stack Overflow:

Can I add navigation arrows to PDF output in SSRS / Report Builder 3.0?
As I mentioned in comments you can create a bookmark in each page. A bookmark can be added using the component DocumentMapLabel property almost all SSRS Report Items (Tablix, Textbox, Charts, etc) have.

If you don’t have a title or a textbox at the very top of each page, add an empty textbox, be sure place them at the top of the page in order to each bookmark jumps to the beginning of the corresponding page.
Select the first textbox and press F4 to see the extended properties window, look for DocumentMapLabel and type Page 1.

In each page set the textbox DocumentMapLabel property to the corresponding page number.
When the report is exported to PDF, your PDF client shows the bookmark menu, containing a bookmark for each page. If you click on a bookmark it jumps to the related page.

So, if you take this concept and run with it, you should discover that many things beyond Page labels can be added here. For example, using Expressions, I added my own labels and incorporated them with field values to make the Raw Material subreport portion of data stand out. Like so:

=“RawMtl-” & Fields!MtlSeq.Value & “-” & Fields!PartNum.Value

Or like so, in the Subassembly Components subreport:

=“SubAsy-” & Fields!SubAsmbl_AssemblySeq.Value & “-” & Fields!PartNum.Value

When you preview your report with meaningful data, and turn on the Bookmarks in your PDF Reader, you should observe that this results in a PDF with additional Bookmarks.

I similarly added Document Map Labels in the main Traveler report too. I found the Group that contained the parent Assembly and then used that to very cleanly show the proper page where the parent assembly changes. I added to the Operations area so that it very cleanly shows the operation number, and then the description of the operation underneath. I believe that it makes the Bookmarks clean and much more robust for a user to navigate.

I think I can post a partial example here so you can see, since it does not reveal anything but generic part numbers and no proprietary process or actual material descriptions.
image

Maybe you have additional thoughts and ideas to enhance this idea?
Enjoy!

4 Likes