Hi all, i have a very crazy situation and i don’t know how to solve it.
I have one controller with two action ACT1 and ACT2.
In each action i load an ActiveDataProvider from two different model DataProvider1 on ACT1 and DataProvider2 on ACT2.
Each action open a view with a kartik gridview with exportmenu.
ACT1>DataProvider1>View1>GridView1
ACT2>DataProvider2>View2>GridView2
Extract in excel in the gridview1 work fine in each type (csv,text,excel 95+,excel 2007+).
My problem is on gridview2 that when i extract in excel (both 95+ and 2007+) i can’t open the file in Excel with the error “the format and the extension of the file are different”.
OK but what is the crazy situation?
To solve my problem i make a test:
In the ACT1 i create also the DataProvider2 but i leave it in the controller, i don’t render DataProvider2 to View1.
Simply $dataProvider2 = $searchModel2->search(); in the controller action1
The crazy situation is that with this instruction, now the GridView1 extraction give me error. I remove this instruction in the ACT1 and now the GridView1 works.
But in the ACT1 i don’t send DataProvider2 to the view1 as parameter. I simply load the search method.
Why this instruction in the controller, can broke kartik ExportMenu in the view1?
I tell you another time. In the view1 i only have DataProvider1 and not DataProvider2. Only for a test i load the DataProvider2 in the ACT1 of the controller.
It’s possible that for some reason the export process run out of memory so the excel file generated is broken?
Please give me any suggestion.
thank’s