Export Excel

Hi, i dont have a cube or an olap Server, just the json file I generate, Is there a way to export the pivot grid without those object?

this is my Code cshtml file
  <div id="PivotGrid1" style="height: 350px; width: 100%; overflow: auto">

<script>
function VentaNF() {
        var f1 = document.getElementById("DatePick").value;
        var f2 = document.getElementById("DatePick2").value;

        $.ajax({
            url: '@Url.Action("JsonVUxClientes", "Test")',
            type: "POST",
            data: {
                d1: f1,
                d2: f2,
                fto: 'NF',
            },

            success: function (result) {
                var formatData = ej.parseJSON(result);                
                   

                $("#PivotGrid1").ejPivotGrid({
                    dataSource: {
                        data: result,
                        rows: [{
                            fieldName: "ClientGroup",
                            fieldCaption: "ClientGroup",
                            sortOrder: ej.PivotAnalysis.SortOrder.Ascending
                        }, {
                            fieldName: "ClientName",
                            fieldCaption: "ClientName",                          
                        }],
                        columns: [{
                            fieldName: "Mont",
                            fieldCaption: "Month"
                        }],
                        values: [{
                            fieldName: "Sales",
                            fieldCaption: "Sales",
                            format: "currency",
                            formatString: "{0:c2}" 

                        }, {
                                fieldName: "SalesUnits",
                                fieldCaption: "SalesUnits",

                            },

                            {
                                fieldName: "ProfitPrct",
                                fieldCaption: "Profit %",
                                format: "percentage",
                                formatString: "{0:P2}"
                               

                              
                        }],

                    },
                    enableGroupingBar: false,
                    enableCollapseByDefault: true

                });
                            
               
           
            }

            });


        }
</script>


1 Reply

SA Scintilla Arul Jothi Raj Syncfusion Team May 8, 2018 01:16 PM UTC

Hi Gian, 

Thanks for using Syncfusion products. 

You can achieve exporting through "JSON Export". Meanwhile, we have prepared a sample for your convenience. Please find the sample and online demo link below for your reference. 
 
 
Please find documentation link below  for more details about Exporting. 

If this doesn’t match your requirement, kindly provide more details about your requirement which would be helpful for us to proceed further. 

Regards, 
Scintilla A 


Loader.
Up arrow icon