Another great question today, this time, from friend and colleague, Jerry the master house re-fitter. I think we are competing on who can completely rip and replace their entire house in the shortest time on their own. Every conversation we have starts with 'so what are you working on?' He's in the midst of a kitchen re-fit, Im finishing off odds and ends before I re-build our stair well and start work on my hidden man cave under said stairs. Anyhoo, his question!
Can you create a PDF document that shows a summary on the first page and provides links to more detailed sections further down in the document?
Why yes you can Jerry. Something like this? Click on the department names in the first table and the return to top links in the detail sections. Pretty neat huh? Dynamic internal links based on the data, in this case the department names.
Its not that hard to do either. Here's the template, RTF only right now.
The important fields in this case are the ones in red, heres their contents.
TopLink
<fo:block id="doctop" />
Just think of it as an anchor to the top of the page called doctop
Back to Top
<fo:basic-link internal-destination="doctop" text-decoration="underline">Back to Top</fo:basic-link>
Just a live link 'Back to Top' if you will, that takes the user to the doc top location i.e. to the top of the page.
DeptLink
<fo:block id="{DEPARTMENT_NAME}"/>
Just like the TopLink above, this just creates an anchor in the document. The neat thing here is that we dynamically name it the actual value of the DEPARTMENT_NAME. Note that this link is inside the for-each:G_DEPT loop so the {DEPARTMENT_NAME} is evaluated each time the loop iterates. The curly braces force the engine to fetch the DEPARTMENT_NAME value before creating the anchor.
DEPARTMENT_NAME
<fo:basic-link internal-destination="{DEPARTMENT_NAME}"><?DEPARTMENT_NAME?></fo:basic-link>
This is the link for the user to be able to navigate to the detail for that department. It does not use a regular MSWord URL, we have to create a field in the template to hold the department name value and apply the link. Note, no text decoration this time i.e. no underline.
You can add a dynamic link on to anything in the summary section. You just need to remember to keep link 'names' as unique as needed for source and destination. You can combine multiple data values into the link name using the concat function.
Template and data available here. Tested with 10 and 11g, will work with all BIP flavors.