ExcelService.GetChartImageUrl Method

SharePoint 2010

Gets a URL value to the chart or PivotChart image file in a workbook.

Namespace:  Microsoft.Office.Excel.Server.WebServices
Assembly:  Microsoft.Office.Excel.Server.WebServices (in Microsoft.Office.Excel.Server.WebServices.dll)

<WebMethodAttribute> _
Public Function GetChartImageUrl ( _
	sessionId As String, _
	size As Size, _
	chartName As String, _
	<OutAttribute> ByRef status As Status() _
) As String
Dim instance As ExcelService
Dim sessionId As String
Dim size As Size
Dim chartName As String
Dim status As Status()
Dim returnValue As String

returnValue = instance.GetChartImageUrl(sessionId, _
	size, chartName, status)


Type: System.String

The Excel Web Services session ID.

Type: Microsoft.Office.Excel.Server.WebServices.Size

The height and width of the requested image. If null (0) or if both the height and width are equal to -1, the original image (default size) is returned.

Type: System.String

The defined name of a chart or PivotChart in the workbook.

Type: []

Alert information.

Return Value

Type: System.String
The URL String value to the chart or PivotChart file.

This method returns only one chart. If multiple charts with the same name exist in the workbook, then the first of those charts (as determined by Excel Services) is returned.

This method returns an error if the requested chart or PivotChart does not exist or is not published. The returned URL is valid for the duration of the session. If the chart image has been purged from the cache and the previously generated URL is requested (that is, the URL generated in the same session), the chart image will be recreated and returned.