cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Add text in the Gantt chart

Former Member
0 Likes
445

Hello all,

We are trying to customize the Gantt chart for a few weeks, without success... Our most concern is to add texts, for instance the task description in the node. We found the .xml file that is loaded (Typerepository_cpr.xml), and also managed to change colors, forms. But we don't know how to retrieve dynamically object data. Is there somewhere a documentation/table where we can find this link?

Thanks for your help.

Matthias

Accepted Solutions (1)

Accepted Solutions (1)

andrea_langlotz
Product and Topic Expert
Product and Topic Expert
0 Likes

Hello Matthias,

has been a while since you posted this...but maybe you are still interested. Basically what you are trying to do is not possible without modification.

To display texts in the graphic part of the Gantt you need to use labels.

<node type="Gantt.CProjects.Node" id="469352A01D895482E10000000A4241A6_ND" rowID="469352A01D895482E10000000A4241A6">

<layer id="469352A01D895482E10000000A4241A6" index="0">

<label>Just a test</label>

....

</layer>

</node>

( you can find a detailed description here [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/com.sap.km.cm.docs/lw/WebDynpro/JNet_JGantt%20Developer%20Documentation/schema/xml-spy/jnet-schema.html] )

By default labels for Gantt nodes are invisible, so you need to remove

<label>

<state type="Invisible"/>

</label>

for all layers in your Typerepository.

And now, how to add the description for your object. You have 2 options

A) In CL_DPR_UI_LOG_GANTT->TRANSFORM_ABAP_2_XML the XSLT Transformation DPR_UI_GANTT_XSLT is called. You can enhance the Import Table

IT_GANTT_DATA_ALL-BAR_DATA by adding a new field for the text. In the XSLT Transformation you need to add the text in the Layer of the Node as described above.

B) Within the XSLT Transformation you read the variable gantt-tree which contains the text already and add the text in the Layer of the Node.

I would recommend to use the first option as you will most definitely run into performance problems with the second.

In addition to the XSLT Transformation DPR_UI_GANTT_XSLT you also need to update DPR_UI_GANTT_XSLT_DELTA.

Hope that helps.

Regards, Andrea

Former Member
0 Likes

Thanks Andrea, I will try your suggestion and come back to you.

Matthias

Former Member
0 Likes

Andrea,

We followed your B suggestion, and it works well. We are now able to display several parameter in the chart, including the object description.

Thanks a lot.

Matthias

Former Member
0 Likes

Hello Matthias,

I am planning to customise the graphic view to add some custom columns to the table view. But, I am not sure if this is possible in cProjects 4.5. If it is possible to add custom columns by customising, I would appreciate if you can give me some pointers to be able add the custom columns to the gantt.

Regards,

Gopal

Former Member
0 Likes

Hi Gopal,

Unfortunately, it's not possible in 4.5 release (only in 5.0).

In 4.5, you have to enhance the DPR_GANTT dynpro with your customer fields.

Matthias

Answers (0)