9 Replies Latest reply: Apr 22, 2013 8:40 AM by Hilary RSS

    Apex 4.2: Project Gantt - parent not displaying correctly

    emma-apex
      Hello

      I have a project gantt with parent_id set in the SQL. Everything shows correctly, e.g. Project 1 has Projects 2,3,4 & 5 as children in my database and they show correctly indented.

      However when I hover on the gantt I notice something odd. So you know on the gantt you have text on the left (in my case set to say Project 1, Project 2 etc), and you have the bars showing on the right. When I hover on a bar on the right, it highlights in light blue - but a different "Project row" is highlighted on the left. What's more when I read the "Task" data in the pop-up when I hover on the bar, it lists the Project name of the wrong project, i.e. the one highlighted and not the one directly to the left. Sometimes it's only a row out, sometimes it's several rows out. When I click on the bar, it takes me to the correct Project details (i.e. the one showing directly to the left, and not the one highlighted / popping up).

      Has anyone come across this before and is there an obvious fix?

      For now I've set parent_id to NULL, but...

      Thanks
      Emma
        • 1. Re: Apex 4.2: Project Gantt - parent not displaying correctly
          Howard (... in Training)
          Seems weird. Good that at least part of it is in synch. May we see your query?

          Re:
          For now I've set parent_id to NULL, but...
          ??? Do you mean you've done this because of -- in response to -- the hover problem? What effect do you get when you do this?

          -- Howard
          • 2. Re: Apex 4.2: Project Gantt - parent not displaying correctly
            emma-apex
            Hi Howard

            Thanks. Yes my query is currently:
            select NULL link, ACTIVITIES_NAME task_name, ACTIVITIES_ID task_id, NULL parent_id, ACTIVITIES_CURRSTARTDATE actual_start, ACTIVITIES_CURRENDDATE actual_end, ACTIVITIES_PROGRESS progress, ACTIVITIES_ORIGSTARTDATE planned_start, ACTIVITIES_ORIGENDDATE planned_end
            from AA_WL_ACTIVITIES3
            order by ACTIVITIES_CURRSTARTDATE asc
            and this works fine (although doesn't group the tasks).

            Previously I was using:
            select NULL link, ACTIVITIES_NAME task_name, ACTIVITIES_PARENT_ID task_id, NULL parent_id, ACTIVITIES_CURRSTARTDATE actual_start, ACTIVITIES_CURRENDDATE actual_end, ACTIVITIES_PROGRESS progress, ACTIVITIES_ORIGSTARTDATE planned_start, ACTIVITIES_ORIGENDDATE planned_end
            from AA_WL_ACTIVITIES3
            order by ACTIVITIES_CURRSTARTDATE asc
            In my DB, parents are tasks just like children, i.e. they have start and end dates. I noticed when I had my gantt showing these grouped, that the parent level gantt bar would display the biggest date range of its children, i.e. it no longer displayed its own dates. I wonder if the chart is expecting parent to be set up with different data from child?

            Thanks
            Emma
            • 3. Re: Apex 4.2: Project Gantt - parent not displaying correctly
              Howard (... in Training)
              I'd like to know more about these. About your previous query.
              select NULL link, 
                ACTIVITIES_NAME task_name,       -- To pair Name (for task_name) 
                ACTIVITIES_PARENT_ID task_id,    -- and PARENT_ID (for task_id) seems strange to me.
                NULL parent_id, 
                ACTIVITIES_CURRSTARTDATE actual_start, 
                ACTIVITIES_CURRENDDATE actual_end, 
                ACTIVITIES_PROGRESS progress, 
                ACTIVITIES_ORIGSTARTDATE planned_start, 
                ACTIVITIES_ORIGENDDATE planned_end
                from AA_WL_ACTIVITIES3
               order by ACTIVITIES_CURRSTARTDATE asc
              To pair Name and PARENT_ID this way seems strange to me. Is that the way it's done?

              Howard
              • 4. Re: Apex 4.2: Project Gantt - parent not displaying correctly
                Howard (... in Training)
                I did a quick search but failed to find a description of how the data should be prepared.

                [I see, you already answered these.]
                Do you give start/stop times for all the tasks, both parent and child tasks. Or do you just give times for the "leaf" tasks and expect it to compute the parent task times?

                What if there is an inconsistency? Task A contains children Tasks B and C but C has an end time different from Task A?

                I'd prefer just to give start/top for the bottom most "leaf" tasks and have it compute the rest. Then it would be consistent.

                Howard

                Edited by: Howard (... in Training) on Apr 5, 2013 6:15 PM
                • 5. Re: Apex 4.2: Project Gantt - parent not displaying correctly
                  Hilary
                  Hi Emma,

                  Would you mind creating a test case on apex.oracle.com, so that I can take a closer look? My gut feeling is that something's up with the parent-child data being represented on the chart, but I'll know more once I've had a chance to look at the XML associated with the chart. Once you've created an example, you can update this thread with a link to the page in question - but if you could enable "Debug" for the application, that would also be helpful.

                  Thanks,
                  Hilary
                  • 6. Re: Apex 4.2: Project Gantt - parent not displaying correctly
                    emma-apex
                    Hilary, Howard, thanks.

                    I've copied parts of the app:

                    http://apex.oracle.com/pls/apex/f?p=10777:20:

                    demo/demo

                    It's the 'MI - Project' tab and the problem is on hover within this page. The pop-up data is also wrong as you will see. Clicking does seem to take me to the right task however.

                    I agree it is likely to be the data or the query causing the problem. There were a few cases where the child start date was less than those of the parent, or where end dates were greater and I have altered all of these - sadly this has not solved the problem. Also, I tried removing the "order by" SQL code at the bottom but that didn't help either.

                    The full query:
                    select NULL link, ACTIVITIES_NAME task_name, ACTIVITIES_ID task_id, activities_parent_id parent_id, ACTIVITIES_CURRSTARTDATE actual_start, >ACTIVITIES_CURRENDDATE actual_end, ACTIVITIES_PROGRESS progress, ACTIVITIES_ORIGSTARTDATE planned_start, ACTIVITIES_ORIGENDDATE >planned_end
                    from AA_WL_ACTIVITIES3
                    order by ACTIVITIES_CURRSTARTDATE asc
                    A sample of data...:
                    TASK_NAME | TASK_ID | PARENT_ID | ACTUAL_START | ACTUAL_END | PROGRESS | PLANNED_START | PLANNED_END
                    Project36 | 36 | | 06/01/2012 | 03/30/2013 | 40 | 06/01/2012 | 10/30/2012
                    PIII | 37 | 36 | 06/01/2012 | 06/30/2012 | 40 | 06/01/2012 | 06/30/2012
                    Project38 | 38 | 36 | 07/01/2012 | 07/30/2012 | 40 | 07/01/2012 | 07/30/2012
                    Project39 | 39 | 36 | 08/03/2012 | 08/15/2012 | 40 | 08/03/2012 | 08/15/2012
                    As ever, help greatly appreciated!
                    • 7. Re: Apex 4.2: Project Gantt - parent not displaying correctly
                      Hilary
                      Hi Emma,

                      Would you mind modifying your query to use a START WITH..CONNECT BY clause, to generate a hierarchical result and see if that makes a difference?
                      select  null             link,
                                 task_name  as name,
                                 task_id    as ID,
                                 parent_id  as parent,
                                 actual_start,
                                 actual_end,
                                 progress,
                                 planned_start,
                                 planned_end
                       from (
                                select ACTIVITIES_NAME             task_name, 
                                          ACTIVITIES_ID            task_id, 
                                          activities_parent_id     parent_id, 
                                          ACTIVITIES_CURRSTARTDATE actual_start, 
                                          ACTIVITIES_CURRENDDATE   actual_end, 
                                          ACTIVITIES_PROGRESS      progress, 
                                          ACTIVITIES_ORIGSTARTDATE planned_start, 
                                          ACTIVITIES_ORIGENDDATE   planned_end
                      from AA_WL_ACTIVITIES3
                      )
                      start with parent is null
                      connect by prior id = parent
                      order siblings by name 
                      I can't test this query as I don't have access to your workspace, so please run it in SQL Workshop first and verify that it works correctly before applying to your chart.

                      Regards,
                      Hilary
                      • 8. Re: Apex 4.2: Project Gantt - parent not displaying correctly
                        emma-apex
                        Thank you very much. Yes, using a hierarchy works. I had to fiddle with the code a bit and for anyone else searching have pasted it below:
                        select NULL link,
                        ACTIVITIES_NAME name,
                        ACTIVITIES_ID id,
                        ACTIVITIES_PARENT_ID parent,
                        ACTIVITIES_CURRSTARTDATE actual_start,
                        ACTIVITIES_CURRENDDATE actual_end,
                        ACTIVITIES_PROGRESS progress,
                        ACTIVITIES_ORIGSTARTDATE planned_start,
                        ACTIVITIES_ORIGENDDATE planned_end
                        from AA_WL_ACTIVITIES3
                        start with ACTIVITIES_PARENT_ID is null
                        connect by prior ACTIVITIES_ID = ACTIVITIES_PARENT_ID
                        order siblings by ACTIVITIES_NAME
                        Thanks
                        Emma
                        • 9. Re: Apex 4.2: Project Gantt - parent not displaying correctly
                          Hilary
                          No worries, Emma,

                          That's great it's working for you now :-)

                          Regards,
                          Hilary