Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Hide Detail Row For Nested Table(Hide Detail Row For Nested Table)
Hide Detail Row For Nested Table [message #886179] Thu, 14 June 2012 11:45 Go to next message
Nitin Sharma is currently offline Nitin SharmaFriend
Messages: 10
Registered: May 2012
Junior Member
Dear All,

I have a master table which lists the ParentTicket IDs with some other details. Then for each of the Parent Ticket IDs I have a nested table which lists down its respective child-ticket IDs. I have a nested table for child ticket IDs in the master table of Parent Ticket ID. There is a scenario when a parent ticket does not have any child. In this scenario there is no entry for the nested table. But there is a redundant blank detail row appears.
How can I make this detail row invisible wherever I do not have any child ticket entries?

Thanks,
Nitin
Re: Hide Detail Row For Nested Table [message #886335 is a reply to message #886179] Thu, 14 June 2012 18:49 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Add a visibility expression to the detail row with the expression:
Total.count() < 1

See attached example.

Jason

On 6/14/2012 7:45 AM, Nitin Sharma wrote:
> Dear All,
>
> I have a master table which lists the ParentTicket IDs with some other
> details. Then for each of the Parent Ticket IDs I have a nested table
> which lists down its respective child-ticket IDs. I have a nested table
> for child ticket IDs in the master table of Parent Ticket ID. There is a
> scenario when a parent ticket does not have any child. In this scenario
> there is no entry for the nested table. But there is a redundant blank
> detail row appears. How can I make this detail row invisible wherever I
> do not have any child ticket entries?
>
> Thanks,
> Nitin
Re: Hide Detail Row For Nested Table [message #886545 is a reply to message #886179] Fri, 15 June 2012 06:40 Go to previous messageGo to next message
Nitin Sharma is currently offline Nitin SharmaFriend
Messages: 10
Registered: May 2012
Junior Member
Jason,

Thanks for replying but this didn't help. The output remained as it is where empty rows were showing up for no child ticket IDs. I have attached my report design.
There is a nested table for Subtask ID in the merged detail row of parent ID. That's where I want this condition to work. So what I want to achieve is that the detail row of the parent table should not appear when there are no entries for the nested Subtask Table.

Please suggest and help.

Thanks,
Nitin

[Updated on: Fri, 15 June 2012 07:28]

Report message to a moderator

Re: Hide Detail Row For Nested Table [message #886828 is a reply to message #886545] Fri, 15 June 2012 17:44 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Nitin

Your report did not come through all the way. If you want to hide the
detail row of the parent table when the child table is empty that is a
bit more difficult. Attached is an example that does it with scripting
and it has to be viewed in the webviewer not with the preview tab at the
bottom of the canvas. This is because of the different event order firing.

Jason

On 6/15/2012 2:40 AM, Nitin Sharma wrote:
> Jason,
>
> Thanks for replying but this didn't help. The output remained as it is where empty rows were showing up for no child ticket IDs. I have attached my report design.
> There is a nested table for Subtask ID in the merged detail row of parent ID. That's where I want this condition to work. So what I want to achieve is that the detail row of the parent table should not appear when there are no entries for the nested Subtask Table.
>
> Please suggest and help.
>
> Thanks,
> Nitin
Re: Hide Detail Row For Nested Table [message #888646 is a reply to message #886828] Mon, 18 June 2012 12:19 Go to previous messageGo to next message
Nitin Sharma is currently offline Nitin SharmaFriend
Messages: 10
Registered: May 2012
Junior Member
Thanks for replying Jason, somehow this thing didn't work. So you have added the script, as mentioned below, at the OnCreate of detail row...correct? Is there any other script also which you have added in your shared example? My scenario becomes a little more difficult because I have done the merging of detail row and added the nested table there. Please ignore if a solution is not feasible in this case. Thanks for your help.

if( typeof myrownum == 'undefined' ){
myrownum = 1;
}else{
myrownum++;
}
Re: Hide Detail Row For Nested Table [message #888784 is a reply to message #888646] Mon, 18 June 2012 16:00 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Did the example I posted work in your environment? Are you using the
view in WebViewer option to display it?

Jason

On 6/18/2012 8:19 AM, Nitin Sharma wrote:
> Thanks for replying Jason, somehow this thing didn't work. So you have
> added the script, as mentioned below, at the OnCreate of detail
> row...correct? Is there any other script also which you have added in
> your shared example? My scenario becomes a little more difficult because
> I have done the merging of detail row and added the nested table there.
> Please ignore if a solution is not feasible in this case. Thanks for
> your help.
>
> if( typeof myrownum == 'undefined' ){
> myrownum = 1;
> }else{
> myrownum++;
> }
Re: Hide Detail Row For Nested Table [message #889925 is a reply to message #888784] Wed, 20 June 2012 09:25 Go to previous messageGo to next message
Nitin Sharma is currently offline Nitin SharmaFriend
Messages: 10
Registered: May 2012
Junior Member
yes the example did run in my environment. Yes I am using the view in WebViewer option.

Thanks,
Nitin
Re: Hide Detail Row For Nested Table [message #890066 is a reply to message #889925] Wed, 20 June 2012 21:40 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

I am not certain why this in not working in your example. In my example
the outer table has an onCreate script on the detail row that increments
a counter for ever row.

if( typeof myrownum == 'undefined' ){
myrownum = 1;
}else{
myrownum++;
}

the nested table has an oncreate on the detail row that references this
variable and sets a persistent global variable based on this row number.

reportContext.setPersistentGlobalVariable(myrownum, "true");

If the nested table row does not get created no variable is stored.
Then finally on the outer tables detail row there is an onrender script
that sets the visibility based on this persistent variable:

if( typeof myrenderrownum == 'undefined' ){
myrenderrownum = 1;
}
var pgv = reportContext.getPersistentGlobalVariable(myrenderrownum);


if( pgv ){
this.getStyle().display = "block";
}else{
this.getStyle().display = "none"
}
myrenderrownum++;


Jason

On 6/20/2012 5:25 AM, Nitin Sharma wrote:
> yes the example did run in my environment. Yes I am using the view in
> WebViewer option.
>
> Thanks,
> Nitin
Re: Hide Detail Row For Nested Table [message #922929 is a reply to message #886179] Tue, 25 September 2012 13:11 Go to previous messageGo to next message
Bryan Vandiviere is currently offline Bryan VandiviereFriend
Messages: 1
Registered: September 2012
Junior Member
Hi Jason,

The script that you posted worked exactly what I am needing for the report I am creating. However, the environment that I need to run the report in is using a Run-And-Render viewer just like the preview.

Would you have any suggestions on what I can do to have the same functionality of if a child table row is empty it hides the row in the parent?

Thanks!
Bryan
Re: Hide Detail Row For Nested Table [message #923328 is a reply to message #922929] Tue, 25 September 2012 20:38 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Bryan

One way of doing this with a runandrender is to reproduce the tables twice and hide the first group using a visibility expression. Then in the hidden groups inner table put an onCreate script on the row like:

if( typeof myarr== 'undefined' ){
ii = 0;
myarr = [];
}
myarr[ii]=this.getRowData().getColumnValue("ORDERNUMBER");
ii++;


Then in the second group of tables put a visibility expression on the outer table's detail row that looks like:

!BirtComp.anyOf(row["ORDERNUMBER"],myarr)

See attached example
Re: Hide Detail Row For Nested Table [message #1053390 is a reply to message #923328] Sat, 04 May 2013 23:15 Go to previous messageGo to next message
Kaushik B is currently offline Kaushik BFriend
Messages: 1
Registered: May 2013
Junior Member
Hi Jason.

Thanks for the help.
Your every reply is helping me.

I used your 1st Method , then I am getting expected output in only web viewer.

Also in above reply of you
Please help me to understand "runandrender"

I used your second method but somehow it is not working.

Please Check my attached rptdesign file if I am doing something wrong.
Method 1:Well in Web Viewer
Method 2:Wrong output


Extra Information about my rptdesign file :

I have created report which shows parent workitems with its respective child workitems in single row.
__________________
Parent 1....Child 1
............Child 2

Parent 2....Child 1
............Child 2
............Child 3
__________________

I used nested table to get the output.
I wanted to display only those workitems (Parents) which has child workitems.
Actual output is listing parents with and without child workitem. :wacko: Mad
__________________
Parent 1...Child 1
...........Child 2
Parent 2...
Parent 3...
Parent 4...Child 1
...........Child 2
...........Child 3
Parent 5...


To list row with only parent-child I refer your answers.

Now I am able to get required output but only in Birt's Web viewer. everywhere >> No output

Not in excel or as html. so no output in RTC web client ()
IBM rational team concert
Please Help me to get required output in every format directly.

Data Source : Jazz Data Source
Rational Team concert 3.0.1

Smile


Regards
Kaushik

[Updated on: Mon, 06 May 2013 07:23]

Report message to a moderator

Re: Hide Detail Row For Nested Table [message #1053870 is a reply to message #1053390] Wed, 08 May 2013 03:16 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1684
Registered: July 2009
Senior Member

runandrender is that you can just run it in preview. From the designer, this would be any output except the web viewer. I'll take a look at your report and let you know if I see where the issue is.

Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Re: Hide Detail Row For Nested Table [message #1053872 is a reply to message #1053870] Wed, 08 May 2013 03:36 Go to previous message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1684
Registered: July 2009
Senior Member

In your visibility expression for the detail row in the second table, can you try something like:

!BirtComp.anyOf(row["WI_ID"],myarr) && !BirtComp.anyOf(row["SUMMARY"],myarr)


Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Previous Topic:Invalid bound column name
Next Topic:any solution for limit runaway report queries ?
Goto Forum:
  


Current Time: Thu Dec 18 00:47:42 GMT 2014

Powered by FUDForum. Page generated in 0.05022 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software