Mar 23 2010

Fixing Report Path For Adobe PDF Viewers

Categories: Universe Design Dave Rathbun @ 11:01 am

We are using the OpenDocument() function to “drill” from one document to another. In order to make report maintenance easier I have created some objects in the universe that contain the proper syntax for the URL required to access this function, as well as one that contains the report path. This way even if we change our folder names or structure I can change the universe and do not have to update every report on the project. This has worked very well for us.

Until my current project.

On this project the primary distribution channel was PDF sent via email. Our users said that the links were not working. And of course every time I tested by logging in to Infoview the links worked just fine. After further investigation by another team member, it seems that our Report Path (in the format [Folder],[Sub Folder] was being truncated at the comma. As a result, the OpenDocument() function was looking for the reports in [Folder] and ignoring the full path. That was a bit of a problem.

As mentioned, our Report Path is stored as an object in the universe. To avoid extra work on each report I had encoded the space in “Sub Folder” as Sub%20Folder when I created the object. Without this encoding the URL would not function as required. The other characters such as [ and ] and the , between the folder names were all presented as-is with no encoding. For one project that distributed and viewed their files purely through Infoview this worked great. But the URL was being truncated when sent to PDF. One small difference was that our folder structure for this project used _ instead of a space in the folder names, but it was all working in Infoview, so it must be okay, right?

Wrong. But it wasn’t the _ that was the problem.

Initially we thought that there was a problem with the PDF generation and investigated that path. However, the solution was ultimately discovered by Brian Durning. It seems that while Infoview was okay with a compound path [Folder],[Sub_Folder] for Adobe the comma had to be encoded in order to work. If not, the comma was taken as part of the data and Adobe stopped looking for additional path information at that point.

I updated the Report Path object from this:

'[Folder],[Sub_Folder]'

to this:

'[Folder]%2C[Sub%5FFolder]'

As an aside, these objects do not parse since they are just text strings. %2C is the hexidecimal code for a comma and %5F is the code for the _ character. Once this fix was in place all of our Adobe links worked. And if you are curious, our Infoview links continued to work just fine.

4 Responses to “Fixing Report Path For Adobe PDF Viewers”

  1. Comment by nod

    Dave, can you explain this a little more? Do you have a separate object hard coded for each report with the syntax above or is this actually a variable?

    The reason I ask is that we requested from busobj a way to know the path of a report (to include in the report footer) and they told us there was nothing we could do. We have a serious case of people copying a corp doc to personal folders with the same name, then when we make a change to the corp doc, they complain that we never changed it. We want to be able to prove that they are not using the report we changed.

  2. Comment by Dave Rathbun

    nod, we have two objects in the universe. One is called Open Document URL and it contains the “http” reference to the open document page. The other is called Report Path and it includes the information listed in this post. These are included in a data provider and then used to construct the actual link via a formula or variable in the report. But by having the open document reference as well as the report path being universe objects, if we ever decide to change the path we can simply update the universe rather than having to edit every report.

    Same thing for the open document URL… if we need to change it as we move from DEV to Q/A and ultimately to production we can update the universe and the reports inherit the changes.

    Hope this clears up any confusion, thanks for the question.

  3. Comment by Nathan

    Dave,
    I have an opendocument question (not necessarily related to the current post). Is it possible to reduce the size of the target child report window to a desired height and width in XI 3.1 SP2

  4. Comment by Dave Rathbun

    I don’t believe that window size parameters are part of the OpenDocument() syntax.

Leave a Reply

If you want to include formulas or code in your comment, please read my Tips for formatting comments first. Tags you can use are listed below.

XHTML: You can use these tags: <a href="" title=""> <acronym title=""> <blockquote cite=""> <code> <em> <strike> <strong> <sup> <sub> <u>

Confirm submission by clicking only the marked checkbox:

 []                 

Please remember that comments that are not related to this blog post may be ignored or deleted without notice. If you're looking for help on a topic you have already posted on BOB then please do not repost your question here.