| layout | post |
|---|---|
| title | webAPI reference for PivotChart |
| description | webAPI reference for PivotChart |
| documentation | ug |
| platform | js |
| keywords | PivotChart , syncfusion, PivotChart webapi |
[POST] /Api/OlapChart/Initialize
It fetches the OLAP data required to initialize the PivotChart from server-end.
| Parameter | Description |
|---|---|
| action | It holds the current action name as string |
| customObject | It contains the custom object passed from client side |
Code: 200
Content-Type: application/json;
Response: serialized JSON string
{% highlight c# %} public Dictionary<string, object> Initialize(Dictionary<string, object> jsonResult) { OlapDataManager DataManager = new OlapDataManager(connectionString); DataManager.SetCurrentReport(CreateOlapReport()); return htmlHelper.GetJsonData(jsonResult["action"].ToString(), DataManager); }
{% endhighlight %}
[POST] /Api/OlapChart/Drill
It fetches the drilled OLAP data required to render the PivotChart control from server-end.
| Parameter | Description |
|---|---|
| action | It holds the current action name as string |
| drilledSeries | It contains the name of the drilled member |
| olapReport | It contains the current report as compressed string |
| customObject | It contains the custom object passed from client side |
Code: 200
Content-Type: application/json;
Response: serialized JSON string
{% highlight c# %} public Dictionary<string, object> Drill(Dictionary<string, object> jsonResult) { OlapDataManager DataManager = new OlapDataManager(connectionString); DataManager.SetCurrentReport(Syncfusion.JavaScript.Olap.Utils.DeserializeOlapReport(jsonResult["olapReport"].ToString())); return htmlHelper.GetJsonData(jsonResult["action"].ToString(), DataManager, jsonResult["drilledSeries"].ToString()); }
{% endhighlight %}
[POST] /Api/OlapChart/Export
It exports the PivotChart control at the instant to the specified format.
| Parameter | Description |
|---|---|
| chartData | It contains the information required to export the control |
Code: 200
Content-Type: application/json
Response: file
{% highlight c# %} public void Export() { string args = HttpContext.Current.Request.Form.GetValues(0)[0]; string fileName = "Sample"; htmlHelper.ExportPivotChart(args, fileName, System.Web.HttpContext.Current.Response); }
{% endhighlight %}
[POST] /Api/OlapChart/ExcelExport
It exports the PivotChart control at the instant to an Excel document.
| Parameter | Description |
|---|---|
| chartData | It contains the information required to export the control to an Excel sheet |
Code: 200
Content-Type: application/json
Response: Excel document
{% highlight c# %} public void ExcelExport() { PivotChartExcelExport pivotChartExcelExport = new PivotChartExcelExport(); string args = HttpContext.Current.Request.Form.GetValues(0)[0]; Dictionary<string, string> chartParams = serializer.Deserialize<Dictionary<string, string>>(args); pivotChartExcelExport.ExportToExcel(chartParams); }
{% endhighlight %}
[POST] /Api/OlapChart/WordExport
It exports the PivotChart control at the instant to a Word document.
| Parameter | Description |
|---|---|
| chartData | It contains the information required to export the control to a Word document |
Code: 200
Content-Type: application/json
Response: Word document
{% highlight c# %} public void WordExport() { PivotChartWordExport pivotChartWordExport = new PivotChartWordExport(); string args = HttpContext.Current.Request.Form.GetValues(0)[0]; Dictionary<string, string> chartParams = serializer.Deserialize<Dictionary<string, string>>(args); pivotChartWordExport.ExportToWord(chartParams); }
{% endhighlight %}
[POST] /Api/OlapChart/PdfExport
It exports the PivotChart control at the instant to a PDF document.
| Parameter | Description |
|---|---|
| chartData | It contains the information required to export the control to a PDF document |
Code: 200
Content-Type: application/json
Response: PDF document
{% highlight c# %} public void PdfExport() { PivotChartPDFExport pivotChartPDFExport = new PivotChartPDFExport(); string args = HttpContext.Current.Request.Form.GetValues(0)[0]; Dictionary<string, string> chartParams = serializer.Deserialize<Dictionary<string, string>>(args); pivotChartPDFExport.ExportToPDF(chartParams); }
{% endhighlight %}
[POST] /Api/OlapChart/ImageExport
It exports the PivotChart control at the instant as an Image in specified format.
| Parameter | Description |
|---|---|
| chartData | It contains the information required to export the control to an image file |
Code: 200
Content-Type: application/json
Response: Image file
{% highlight c# %} public void ImageExport() { PivotChartImageExport pivotChartImageExport = new PivotChartImageExport(); string args = HttpContext.Current.Request.Form.GetValues(0)[0]; Dictionary<string, string> chartParams = serializer.Deserialize<Dictionary<string, string>>(args); pivotChartImageExport.ExportToImage(chartParams); }
{% endhighlight %}