Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I've found the problem and a workaround after a long debugging session. </p> <pre><code>// incomplete code example for(Object table : db.getTables()) { ITable t = (ITable)((ITable)table).clone(true); System.out.println(t.getName()); // modifying t, bag is an existing instance of class PropertyBag t.getConnectionInfo().setAttributes(bag); // dc is an existing instance of DatabaseController dc.setTableLocation((ITable)table, t) } </code></pre> <p><code>db.getTables()</code> contains 3 tables A, B and C. If we'll run the code above <code>System.out</code> prints A, A, B to the console.</p> <p>If we're going to comment <code>dc.setTableLocation((ITable)table, t)</code> out. A, B, C will be printed. I assume that <code>dc.setTableLocation((ITable)table, t)</code> modifies internally the list of tables. </p> <p>We're using following workaround:</p> <pre><code>// incomplete code example // WORKAROUND CODE Map&lt;ITable, ITable&gt; oldNewMap = new HashMap&lt;ITable, ITable&gt;(); for(Object table : db.getTables()) { ITable t = (ITable)((ITable)table).clone(true); System.out.println(t.getName()); // modifying t, bag is an existing instance of class PropertyBag t.getConnectionInfo().setAttributes(bag); // WORKAROUND CODE oldNewMap.put((ITable)table, t); } // WORKAROUND CODE for (Entry&lt;ITable, ITable&gt; e : oldNewMap.entrySet()) { dc.setTableLocation(e.getKey(), e.getValue()); } </code></pre> <p>I hope somebody will save time and money with this workaround. ;-) I posted it to the official forum as well.</p> <p><a href="https://forums.sdn.sap.com/thread.jspa?threadID=1214278" rel="nofollow noreferrer">Forum: Java Development - Crystal Reports </a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload