Business Objects 4 "OpenDocument" URL not working with parameters
<p>I have a .Net app which was previously using BO 3.x's <code>OpenDocument</code> URL to open a <strong>particular instance</strong> of Webi Report, with a particular set of parameter values.  It worked brilliantly.</p>

<p>But with BO 4.1 and 4.2, whenever I use <code>&amp;sInstance=Param</code> to get <code>OpenDocument</code> to open a particular instance of a report, it fails miserably, silently throws a Java error, and leaves me with an (almost) blank webpage.</p>

<p>Does <code>OpenDocument</code> <em>work</em> anymore with <code>&amp;sInstance=Param</code> ?</p>

<p><strong>I received the following email on August 6, 2016:</strong></p>

<p>"Issue reproducible on BI 4.2 SP2 Patch 2. This issue has been resolved on BI 4.2 SP2 Patch 3. Regards..."</p>

<p>September 2016: Just to confirm, with the latest patch, <code>OpenDocument</code> does (finally) work properly again, managing to open a particular instance of a Webi report.</p>

<p><strong>Description of problem (for other BO victims)...</strong></p>

<p>It's been a couple of months since I posted this article, no one the SAP forum has offered any help, and I'm <em>still</em> stuck on this problem.</p>

<p>Here's a step-by-step guide of how to reproduce the issue.</p>

<p>To keep things simple, I now have a "dumb" BO Report, which merely takes two parameters, and shows their values in a report.  Nothing more.  </p>

<p>I have a few instances of this report, and what I'm trying to do is open a <strong>specific instance</strong> of that report, using an <code>OpenDocument</code> URL.  Here's the history of my dumb report, and you can see I have 3 instances of it.</p>

<p><a href="https://i.stack.imgur.com/ZRGRy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZRGRy.png" alt="enter image description here"></a></p>

<p>If I open the instance whose parameters are <code>AVE;CHF</code> then I see this:</p>

<p><a href="https://i.stack.imgur.com/InP7g.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/InP7g.png" alt="enter image description here"></a></p>

<p>Wonderful.</p>

<p>Now, I want to open this particular instance of the report <em>programmatically</em>. using <code>OpenDocument</code>.  In the "real" version of my app, these reports are refreshed each night, and each instance might take 20 minutes to refresh, so I <em>do not</em> want to let <code>OpenDocument</code> refresh the report... merely to open an existing instance of a report.</p>

<p>My report takes two parameters called <code>FX Type</code> and <code>Currency</code>, and I try to open the report using this <code>OpenDocument</code> URL  (split into separate lines, for readability) :</p>

<pre><code>http://MyServer:6405/BOE/OpenDocument/opendoc/openDocument.jsp?
  iDocID=AdF8qLrXtBdEgJxiPvS8s6Q
  &amp;sIDType=CUID
  &amp;sOutputFormat=H
  &amp;sType=wid
  &amp;sRefresh=N
  &amp;sInstance=Param
  &amp;lsMFX+Type=AVE
  &amp;lsMCurrency=GBP
  &amp;token=blahblahblah
</code></pre>

<p>When I open this URL, I just get this, in both Chrome and IE11.</p>

<p><a href="https://i.stack.imgur.com/y7Ytg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/y7Ytg.png" alt="enter image description here"></a></p>

<p>Notice how the right-hand panel shows that it <em>has</em> got that report's details... so I am logged on correctly and it managed to find the correct report, but the report area is blank.</p>

<p>Being the geek I am, I used Google Chrome to Inspect the blank area, and found this..</p>

<p><a href="https://i.stack.imgur.com/gw1Q9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gw1Q9.png" alt="enter image description here"></a></p>

<p>Basically, Webi has thrown a Java error, and Webi has decided not to tell the user.  </p>

<pre><code>&lt;body&gt;
    &lt;script type="text/javascript"&gt;
         onInvisibleError({actionId: '4587', message: 'while trying to invoke the method java.lang.String.length() of a null object loaded from local variable \'sToDecode\''});
    &lt;/script&gt;
&lt;/body&gt;
</code></pre>

<p><strong>Removing &amp;sInstance=Param from the URL</strong></p>

<p>Back in my URL, if I remove the section <code>&amp;sInstance=Param</code> then the report <em>does</em> open successfully, and shows the parameter values correctly.  But, crucially, it refreshes the report, which is what I don't want.</p>

<p>We already have an instance of this report, I don't want to wait 20 minutes for my report to refresh, when this instance already exists.</p>

<p><strong>Replacing &amp;sInstance=Param with &amp;sInstance=Last</strong></p>

<p>Out of interest/desperation, I tried to get <code>OpenDocument</code> to simply open the most recent instance of my report.</p>

<pre><code>&amp;sInstance=Last
</code></pre>

<p>When I did this, it worked as expected.  My report opened perfectly, it didn't refresh the report, but, of course, it opened whichever instance was last created.</p>

<p><strong>Parameter Names containing a space</strong></p>

<p>When I originally posted this article, some readers recommended using <code>%20</code> instead of <code>+</code> in any parameter names containing a space.</p>

<p>I should say, if I take my <code>OpenDocument</code> URL, remove the <code>&amp;sInstance=Param</code> section, and modify the <code>FX Type</code> parameter from <code>&amp;lsMFX+Type=AVE</code> to <code>&amp;lsMFX+Type=CHF</code>, then report refreshes using this new FX Type value.</p>

<p>So the URL definitely is parsing the URL correctly, and setting the two parameter values to the correct parameter names.  But then it falls over when trying to find an existing instance.</p>

<p><strong>Final thoughts</strong></p>

<p>So.  In a (longwinded) nutshell, if I use <code>&amp;sInstance=Param</code>, BO v4.2 (and v4.1) quietly throws an error and returns a blank screen.</p>

<p>It won't let me load an existing instance of a Webi report.</p>

<p>And SAP's support seems to have gone AWOL.</p>

<p>Has anyone seen this problem, or found a workaround ?</p>

<p><strong>One day later...</strong></p>

<p>This morning, I created a second Webi Report, with a hyperlink to the "Mikes Test" report.</p>

<p><a href="https://i.stack.imgur.com/PQLGJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PQLGJ.png" alt="enter image description here"></a></p>

<p>When I clicked on this link, it successfully opened my Webi report with the specified parameters.  No problem there.</p>

<p>But when I changed the "Target Window" setting from "Current Window" to "New Window"...</p>

<p><a href="https://i.stack.imgur.com/9uy0C.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9uy0C.png" alt="enter image description here"></a></p>

<p>...look what happens when I click on the hyperlink...</p>

<p><a href="https://i.stack.imgur.com/N6Wvx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/N6Wvx.png" alt="enter image description here"></a></p>

<p>It's our Java error again !</p>

<p>So, I think this proves that this <em>is</em> a bug in BO 4.2 itself.  </p>

<p>Even the Hyperlink URLs it creates itself aren't able to open a specific instance of a Webi report.</p>

<p>SAP... over to you...</p>