Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Visibility with export to Excel with output to multiple sheets
Nancy Stanger
<p>Hi,</p>
<p>I have created a BIRT report with multiple data tables in different formats: one format to show in html and export to pdf and 2 different formats to export to Excel and not to show in html.</p>
<p>
Because I have 2 different Excel tables I want to export content to Excel and check the box for 'Output to multiple sheets' so that each table is created in a different tab.</p>
<p> </p>
<p>I am trying to set the Visibility property on each of these 3 tables to 'hide for specific outputs'. It seems that if I specify the 'hide' for xls and xlsx (and I have also included native) and do not specify 'output to multiple sheets' the visibility will work and the table will be hidden but if I specify 'output to multiple sheets' there will be a worksheet with a tab for this table but no data. Since this table has a grouping and can create a page for each group the output to Excel has multiple tabs that have no data.</p>
<p> </p>
<p>I have attached a screenshot that shows the output with Event_Strategy_List3 /4 /5 /6 having no data.</p>
<p> </p>
<p>Can you please steer me in the right direction to set the properties correctly.</p>
<p> </p>
<p>Thanks,</p>
<p>Nancy</p>
Find more posts tagged with
Comments
Chad Montgomery
<p>Hi Nancy, it seems your picture didn't get posted.</p>
<p>
Also, are you using open source or professional?<br>
</p>
Nancy Stanger
<p>I am using BIRT in Eclipse Platform version 3.6.2.</p>
Chad Montgomery
<p>In your visibility tab for the table(s) that you want to hide from xls, select "Hide Element" and "For all outputs." Go into the expression editor and add this code:</p>
<pre class="_prettyXprint _lang-">
if(reportContext.getOutputFormat() == "xls")
true
else
false
</pre>
<p>This should prevent the empty pages from being generated.</p>
<p> </p>
<p>You can use this code to preventing output to any other type of file type as well, just replace "xls" with "html", "xlsx", "pdf", etc.</p>
<p>Let me know if this works for you, as I was unable to find your specific version to attempt this with.</p>
Nancy Stanger
<p>Thanks for the suggestion. It did not work.<br>
Test 1 - tried code as you suggested and this caused the data in the table to be hidden to show in the xls/xlsx output</p>
<p>Test 2 - used the same code but reversed the true/false and this caused the blank worksheets to be included, similar to the original problem</p>
<p>NOTE: both these examples caused the tabs for the xls/xlsx hidden table to be named correctly, but the naming of the tabs is a different problem .<br>
Attached are screenshots of these tests.</p>
Chad Montgomery
<p>Nancy,<br>
<br>
I've attached a picture indicating what it should look like. In the case of hiding it for multiple output types you need to add OR operators inside the if statement like so:</p>
<pre class="_prettyXprint _lang-">
if(reportContext.getOutputFormat() == "xls" || reportContext.getOutputFormat() == "xlsx")
</pre>
<p>I would suggest just testing with a single output format for now until you can verify that it works though.</p>
<p> </p>
<p>If this still doesn't work, could you post a picture of the about window, and if possible could you upload your report design? Are you using a custom Excel emitter such as spudsoft?</p>
Nancy Stanger
<p>I tested just with xlsx and got the same result as test 1, above. i.e. the table is not hidden.</p>
<p>Attached are screenshots, including the information about my version of BIRT.</p>
Chad Montgomery
<p>This is interesting. I'm not able to replicate your issue unfortunately. Would it be possible for me to take a look at your .rptdesign file?</p>
Nancy Stanger
<p>Our policy is not to send the .rptdesign file. I have discussed other options to solve my problem so will not need to hide the tables. Thank you very much for your help.</p>
Chad Montgomery
<p>No problem Nancy, I apologize I couldn't help further!</p>