cancel
Showing results for 
Search instead for 
Did you mean: 

Using Customizing in BusinessGraphic

Former Member
0 Kudos

Hello,

I need to dynamically set the title of a BusinessGraphic to include the current date. I will need to change it through code and the only example I have seen involves using the Chart Designer. I believe I need to use the "customizing" property to use an xml file. Can anyone point me to an example on how this is done?

Thank You.

Accepted Solutions (1)

Accepted Solutions (1)

roberto_tagliento
Active Contributor
0 Kudos

Look there.

And use


graphic.setDirectCustomizing(cuString.toString());

to set dynamically the XML Customizing.

I explain again how retrieve the XML Customizing that Chart Designer create.

Create your chart with Chart Designer and save all metadata.

Pass to "Navigator" panel, find the view file.

Something like:

$YOUR_NAME_VIEW$.wdview

into your package tree

Open it like a normal TEXT file, inside you must find the XML Customizing that Chart Designer created.

Bye

Former Member
0 Kudos

I have tried using the following code in the wdDoModifyView:

final IWDBusinessGraphics gfx = (IWDBusinessGraphics) view.getElement("BusinessGraphic");
final StringBuffer cuString = new StringBuffer(1024);
 
cuString.append("<?xml version="1.0" encoding="ascii"?>"); 
cuString.append("<SAPChartCustomizing>");
cuString.append("<Title>");
	
cuString.append("<Caption="");
cuString.append("Average Dispatch Type FEBRUARY 20, 2007");
cuString.append("">");
cuString.append("</Caption>");
 
cuString.append("</Title>");
cuString.append("</SAPChartCustomizing>");
 
gfx.setDirectCustomizing( cuString.toString() );

I am hardcoding the date for now. I have found that file you are talking about. Are you opening that file and overwriting the values you need to change? Or do you overwrite it through code? I will need to change the values in that file every time I generate the graph and cannot do it manually.

Thanks for the help.

roberto_tagliento
Active Contributor
0 Kudos

Nooooo

You cannot overwrite that file!

From there you must take only the complete XML.

And after by code

cuString.append("<?xml version=\"1.0\" encoding=\"ascii\"?>");

cuString.append("<SAPChartCustomizing>");

cuString.append("<Title>");

...........

cuString.append("<Caption=\"");

cuString.append("Average Dispatch Type FEBRUARY 20, 2007");

cuString.append("\">");

cuString.append("</Caption>");

..........

cuString.append("</Title>");

cuString.append("</SAPChartCustomizing>");

all XML TAG!

Changing only wished part.

i use only one CODE line

cuString.append("<?xml version=\"1.0\" encoding=\"ascii\"?> ...... </SAPChartCustomizing>");

Using TextPAD editor for example, change the wished part and transform the XML in only one line.

Really i have something like:

cuString.append("<?xml version=\"1.0\" encoding=\"ascii\"?> ...... ");

cuString.append("..."JAVA_VARIABLE"....");

cuString.append(" </SAPChartCustomizing>");

Try this way

Former Member
0 Kudos

Thank you for the help. I believe I have it working now.

Answers (1)

Answers (1)

roberto_tagliento
Active Contributor
0 Kudos

Look here.

just yesterday i done!