Problem downloading excel Pivot when I add enginePopulated

I have a problem, when I add enginePopulated to my pivot to perform certain functions, the function to download the excel doesn't work and throws this error.


I tried to replicate this error on stackblitz but it works fine.

https://stackblitz.com/edit/ed7dya-kv2z4l?file=index.js

The only difference is that I am handling an eval to transform the pivot configuration from text to javascript code.

for example:

data = eval(elem_unimeds.gridOptions.enginePopulated);
eval("elem_unimeds.gridOptions.enginePopulated=" + this.fun);
//Inicializa el grid (Detalle)
var pivotObj = new ej.pivotview.PivotView(elem_unimeds.gridOptions);
pivotObj.appendTo("#" + elem_unimeds.grid_id);

I hope you can help me with some suggestions. Thanks in advance.


3 Replies

AP AngelinFaithSheeba PaulvannanRajadurai Syncfusion Team March 23, 2022 01:47 PM UTC

Hi louis, 

Could you please tell us why you convert the text to JavaScript using the eval() function, which results in the reported problem on your end? Could you also please provide us your sample with the reported problem replicates in a runnable state? This would allow us to investigate the reported problem on our end and respond as quickly as possible. 
 
Regards,  
Angelin Faith Sheeba. 



LG Luis Guerrero March 23, 2022 06:44 PM UTC

This is because part of the pivot configuration, such as the data from the datasource, I do from a backend (in this case Django), and I bring it as text to the frontend.

Since most of the html code can be handled by views(view.py) to render on the frontend.







AP AngelinFaithSheeba PaulvannanRajadurai Syncfusion Team March 24, 2022 06:58 PM UTC

Hi Luis,


We are unable to reproduce the reported problem at our end. For your reference, we have attached a sample link that we tested.


Sample: https://stackblitz.com/edit/ed7dya-maxtqd?file=index.js


If still the problem persists, please share your sample and string data (or) reproduce it in the provided sample and revert to us.



Regards,

Angelin Faith Sheeba.


Loader.
Up arrow icon