cancel
Showing results for 
Search instead for 
Did you mean: 

Create piechart with rest api

Former Member
0 Kudos

Hi,

I have created piechart with rest api by creating dataprovider in document and updated query specification and finally with updating report specification.  Piechart is created but label name is showing as [?? DP0.DS1??] instead of column name as state . Please find snap as below.

Thanks,

Amol.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member197386
Active Contributor
0 Kudos

Hi Amol,

Could you share the XML or JSON input you sent to Webi RESTful API?

I'ld like to check if everything looks good.

Best regards,

Anthony

Former Member
0 Kudos


Hi Anthony,

please find XML which is used to update report specification.

REPORT rId="1" name="Report 1">


<PAGEDEF>


<MARGIN bottom="2835" top="2835" left="2835" right="2835" />


<RECORDS horizontal="20" vertical="100" />


</PAGEDEF>


<PAGE_HEADER bId="1" />


<PAGE_BODY bId="2">


<CELL bId="4" x="7416" y="432" width="15048" height="1548">


<STYLE>


<BORDER side="bottom" width="0" style="none" />


<FONT size="16" bold="no" underline="yes" />


</STYLE>


<CONTENT>=ReportName()</CONTENT>


</CELL>


<VISU bId="13" name="Block 1" x="450" y="900" verticalAttachTo="4"


verticalAttachType="end">


<DATA />


<HIDE />


<LEGEND visible="yes" position="east">


<STYLE>


<BORDER width="0">


<COLOR color="#000000" alpha="0" />


</BORDER>


<FONT face="Arial" size="8" color="#707070" bold="yes" />


<BACKGROUND>


<COLOR color="#000000" alpha="0" />


</BACKGROUND>


</STYLE>


<TITLE visible="yes">


<STYLE>


<BORDER width="0">


<COLOR color="#000000" alpha="255" />


</BORDER>


<FONT face="Arial" size="8" color="#000000" bold="yes" />


<BACKGROUND>


<COLOR color="#000000" alpha="0" />


</BACKGROUND>


</STYLE>


<TEXTHALIGN value="left" />


<TEXTVALIGN value="center" />


</TITLE>


</LEGEND>


<TITLE visible="no" label="=&quot;My Title&quot;">


<STYLE>


<BORDER width="0">


<COLOR color="#000000" alpha="255" />


</BORDER>


<FONT face="Arial" size="9" color="#000000" bold="yes" />


<BACKGROUND>


<COLOR color="#000000" alpha="0" />


</BACKGROUND>


</STYLE>


<TEXTHALIGN value="left" />


<TEXTVALIGN value="center" />


</TITLE>


<DATA_LABELS visible="no" datatype="auto">


<STYLE>


<BORDER width="0">


<COLOR color="#000000" alpha="255" />


</BORDER>


<FONT face="Arial" size="8" color="#707070" bold="yes" />


<BACKGROUND>


<COLOR color="#000000" alpha="0" />


</BACKGROUND>


</STYLE>


</DATA_LABELS>


<PLOTAREA>


<COLOR color="#ffffff" alpha="255" />


</PLOTAREA>


<FLOOR visible="no" />


<PALETTE>


<STANDARD id="default" />


</PALETTE>


<PIE look3d="no">


<FEEDS>


<PIE_SECTOR_SIZE>


<FEED_EXPR>


<CONTENT>=[Revenue]</CONTENT>


<FORMAT positive="" negative="" zero="" undefined="" />


</FEED_EXPR>


</PIE_SECTOR_SIZE>


<PIE_SECTOR_COLOR>


<FEED_EXPR>


<CONTENT>=[State]</CONTENT>


<FORMAT positive="" negative="" zero="" undefined="" />


</FEED_EXPR>


</PIE_SECTOR_COLOR>


</FEEDS>


</PIE>


</VISU>


</PAGE_BODY>


<PAGE_FOOTER bId="3" />


</REPORT>

Thanks,

Amol.

former_member197386
Active Contributor
0 Kudos

Ok,

You're using /specification API. Although it is deprecated (because this API will rebuild the full report), it is still supported. I will check why you get this output.

Alternatively, you could also try the "native" Webi RESTful API for charts manipulation:

.../documents/{docId}/reports/{reportId}/elements/{elementId}

Best regards,

Anthony

Former Member
0 Kudos

Hi Anthony,

I will try elements alternative also. could you please provide workflow to create chart by using update element API.

Thanks,

Amol

former_member197386
Active Contributor
0 Kudos

Hello Amol,

We've tried to reproduce internally with provided information but unfortunately without success.
You can open a CSS ticket to get support from SAP support.

About alternative API, you can look at : /documents/.../reports/.../elements/... API.

Regards,

Anthony