Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
DEAPI -How to move table from a grid to the body
grather
<p>I have a need to output a report to CSV.</p>
<p> </p>
<p>For this emitter I need the table to be at the top level not embedded in a Grid.</p>
<p> </p>
<p>So I tried the following</p>
<p> </p>
<p>ReportDesignHandle rDesign = getDesignFile(request,response,designFileTmp.getAbsolutePath());</p>
<p> </p>
<p>// Get the Object I want to move</p>
<p>TableHandle table1 = (TableHandle)rDesign.findElement(<span style="color:#008000;font-weight:bold;">"Table_1"</span>);</p>
<p> </p>
<p> </p>
<p>// Get the grid the table is currently in</p>
<p>DesignElementHandle baseGrid = rDesign.findElement(<span style="color:#008000;font-weight:bold;">"BaseGrid"</span>);</p>
<p> </p>
<p>// Drop the existing Grid and table</p>
<p>baseGrid.dropAndClear();</p>
<p> </p>
<p>// Add the table to the body</p>
<p>rDesign.getBody().add( newTable );</p>
<p> </p>
<p>
</p>
<p> </p>
<p>But when I try to open this I get a Corrupted file.</p>
<p>So I am missing something.</p>
<p> </p>
<p> </p>
<p> </p>
Find more posts tagged with
Comments
grather
<p>For anyone who may care.</p>
<p> </p>
<p>Turned out to be simpler than I was making it.</p>
<p> </p>
<p>The Task to make the rptdesign compatible with a CSV render.</p>
<p>The Render requires the "Table" to be at the root of the layout. </p>
<p> </p>
<p>My rptdesign has a Tob level Grid (Named TopGrid)</p>
<p>then then a grid for a Report display header.</p>
<p> </p>
<p>Then the table </p>
<p> </p>
<p>===================</p>
<p> </p>
<p>So want to movew the table (Table_1) to the body. And remove the rest .</p>
<p> </p>
<p>// So first get a handle on the table to move andf then move it to the body</p>
<p><span style="background-color:#e4e4ff;">TableHandle</span> table1 = (<span style="background-color:#e4e4ff;">TableHandle</span>) rDesign.findElement(<span style="color:#008000;font-weight:bold;">"Table_1"</span>);<br>
table1.moveTo(rDesign.getBody().getElementHandle(), <span style="color:#0000ff;">6</span>);</p>
<p> </p>
<p>// Then remove the remaining stuff</p>
<p>GridHandle topGrid = (GridHandle) rDesign.findElement(<span style="color:#008000;font-weight:bold;">"TopGrid"</span>);<br>
topGrid.dropAndClear();</p>