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)
embedded table
HSMorales
I have a report with 2 tables binded to 2 different datasets.
Table_1 has a header section and a detail section.
In the detail section of Table_1, I embedded Table_2.
Table_2 has a filter equating a field to a field in table_1.
The dataset for table_2 has a computed column of Row_Count to count the number of rows.
How can I suppress the detail section of Table_1 when Table_2 row_Count is 0 ??
I have a border around the header of Table_1 and when there is no detail, the border line seems to double in width.
I am doing it this way because I am unable to use a merged dataset.
Thanks for all Your Help.
BIRT 3.7.0
Find more posts tagged with
Comments
mwilliams
You can set a PersistentGlobalVariable with the value of your computed column in the onCreate of your inner table. Then, you can recall this PGV in the detail row's onRender script and set the display style property to NONE. You'll have to make sure you run the report in the viewer and then export it to the output you want, from the designer. When you deploy, just be sure to run the report with the frameset url. Let me know if you need an example.
HSMorales
Do I Select the table, Click on Advanced (under Property tab), then On create .
What syntax do I use ?
I named the computed column ROW_COUNT .
What syntax do I use for the onRender in the detail row for the outer table?
I think an example would be great. Thanks for all your help.
P.S. Is there a course available anywhere that covers scripting for On Create, On Render and explains where
these take place in the processing of the report?
mwilliams
Take a look at this report. Be sure to run it in the web viewer.
As for the script order, take a look at this:
http://www.eclipse.org/birt/phoenix/deploy/reportScripting.php
HSMorales
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="105459" data-time="1340988324" data-date="29 June 2012 - 09:45 AM"><p>
Take a look at this report. Be sure to run it in the web viewer.<br />
<br />
As for the script order, take a look at this:<br />
<br />
<a class='bbc_url' href='
http://www.eclipse.org/birt/phoenix/deploy/reportScripting.php'>http://www.eclipse.org/birt/phoenix/deploy/reportScripting.php</a><br
/></p></blockquote>
HSMorales
Can I assign numeric data (ROW_COUNT) to a PGV ??
I tried to use :
reportContext.setPersistentGlobalVariable("LFNB",row["ROW_COUNT"]);
but it gives me an error.
mwilliams
Try this: reportContext.setPersistentGlobalVariable("LFNB",new Number(row["ROW_COUNT"]));
HSMorales
Worked great thanks.
I'm having a different problem now.
Is there an easy way to line up the columns from the inbedded table to the columns of the outside table?
I have a border around the fields in both the embedded table and the outside table.
I have the same number of columns in each with the same size width for each column but can't get them to line up perfect.
The embedded table is in the detail section of the outer table. I've tried changing the margin and padding for both the embedded table and the detail row of the outer table
but can't seem to get it right.
Also, I get a different view if I do a "Preview" in birt than I do if I do a (Run, View Report, As PDF)
mwilliams
Can you attach a report using the sample database, so I can see the exact layout and all you've done and can test on it? Thanks!