ExportExcel don't work

Thread ID:

Created:

Updated:

Platform:

Replies:

Greetings, we are using the treegrid (javascript version) and we need it to export in excel and pdf.However, the TreeGridProperties property is not accepted into the export method of ExcelExport and when we try using theGridProperties or GanttProprierties, it throws a nullexception when it attempt to generate.

Error: Object reference not set to an instance of an object.

And when we try to generate the pdf file, it generates no data, even following all the documentation steps.

We have analyzed your reported issue in our sample. While exporting TreeGrid data, we must use TreeGridProperierties class type of treeGrid model. For that we have to serilzed the treeGrid model object before passing it to export method.

Good afternoon,
I tried to implement it according to the example you sent, but when I try to export it it gives the following error: Could not load file or assembly 'Syncfusion.Pdf.Base, Version = 15.2450.0.46, Culture = neutral, PublicKeyToken = 3d67ed1f87d44c89' or One of its dependencies. The localized assembly manifest definition does not match the assembly reference. (Exception of HRESULT: 0x80131040)Ehe file Syncfusion.Pdf.Base is the only one with version 15.1460.0.33
Translated text in Google Translate.
Thanks,
Regards,
Daniela.

We have analyzed the reported exception and it says that you are using different assembly version and different framework. It is important that all the assemblies should be same framework and same version refer in your project because these are dependent with one another.

Note: if dll’s framework version is higher than project framework then it will not work in your project and ensure assembly versions are properly mentioned in web.config file.

If you are same facing the same issue again then please share you demo project which can able to reproduce the reported issue. It will be helpful for us to serve you better.

Hi,Now with the
problem of reference neat, it continues giving error, being the export
to excel giving null reference and the export to pdf is exporting
without data.Follow the download link for the project being used: https://drive.google.com/file/d/0B-Djm-qROoSzRnVVMmRIRjNKRUU/view?usp=sharing

We have analyzed your given sample and noticed that old scripts and theme files were referred in the sample. It is important that dll’s, scripts & themes files should be same version.

In your sample, exporting has perform using JS TreeGrid code in MVC platform for that declared separate data sources like JSON data used in client side to render TreeGrid and list used in server side to export TreeGrid.

But, the field names used for the both data source are different. So, client side column field name and server side data source field are completely mismatch. This is the reason for export Pdf as empty and excel export getting an exception.

It is mandatory that use common data source for both client and server side.

We have created a sample in the version of 15.2.0.46 using webAPI controller to handle exporting action.

So in my tests I'm getting information from the bank and moving on to a dynamic list variable. After that, I format for json and deal without javascript. So, all dynamically, being the dataSource of the ejTreeGrid, updated after some filters. Follow the code below:

Your example shows how to do it using webApi, but I do not intend to use it.And since I'm doing the list dynamically, without a model, would you know how I could get the information that is on the grid?