We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Export failing

Thread ID:

Created:

Updated:

Platform:

Replies:

131017 Jun 16,2017 08:50 AM Jul 4,2017 12:12 PM Angular 12
loading
Tags: ejGrid
Me
Asked On June 16, 2017 08:50 AM

Hello,

Trying to implement export, to my WebAPI RESTful backend with your components, but so far no luck.

Syncfusion and your dll files version is: 15.1451.0.41 - Won't upgrade to latest ones at the moment.

Error:

Controller method (GridModel sent from frontEnd is attached in zip file as txt):
        [HttpPost]
        [AllowAnonymous]
        public void ExportToExcel([FromBody]RequestParametersForGrid requestParametersForGrid)
        {
            ExcelExport we = new ExcelExport();

            string gridModel = requestParametersForGrid.GridModel; //HttpContext.Current.Request.Params["GridModel"];
            GridProperties gridProperty = ConvertGridObject(gridModel);
            gridProperty.Columns.RemoveRange(2, gridProperty.Columns.Count -3);
            ExcelExport exp = new ExcelExport();

            var testList = new List<TestItem>();
            for (var i = 2; i < 100; i++ )
                testList.Add(new TestItem { ItemId = i, ItemCode = "hoooo" + i, DivisionName = "Hhhhhhh" + i });



            exp.Export(gridProperty, testList, "MyTestExport.xlsx", ExcelVersion.Excel2010, false, false, "flat-saffron");

        }


Added dependentAssembly to web.config
      <dependentAssembly>
        <assemblyIdentity name="Syncfusion.EJ" publicKeyToken="3d67ed1f87d44c89"/>
            <bindingRedirect oldVersion="0.0.0.0-15.1451.0.41" newVersion="15.1451.0.41"/>
       </dependentAssembly>

References added:


Sometimes it won't throw any error but also won't return anything - Download failed. Any ideas?





Attachment: GridModel_381cf8d4.zip

Me
Replied On June 16, 2017 09:01 AM

This is what I get sometimes when there are no errors for the same code:

    1. Request URL:
      http://localhost:57526/list/ExportToExcel
    2. Request Method:
      POST
    3. Status Code:
      200 OK
    4. Remote Address:
      [::1]:57526
    5. Referrer Policy:
      no-referrer-when-downgrade
  1. Response Headersview parsed
    1. HTTP/1.1 200 OK Cache-Control: private Transfer-Encoding: chunked Content-Type: Application/vnd.openxmlformats-officedocument.spreadsheetml.sheet Server: Microsoft-IIS/10.0 Content-Disposition: attachment; filename=MyTestExport.xlsx; X-AspNet-Version: 4.0.30319 X-SourceFiles: =?UTF-8?B?RTpcR1BcR1BXZWJcR1BXZWIuV2ViQVBJXGxpc3RcRXhwb3J0VG9FeGNlbA==?= X-Powered-By: ASP.NET Date: Fri, 16 Jun 2017 12:59:41 GMT
  2. Request Headersview parsed
    1. POST /list/ExportToExcel HTTP/1.1 Host: localhost:57526 Connection: keep-alive Content-Length: 13109 Cache-Control: max-age=0 Origin: http://localhost:3000 Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Content-Type: application/x-www-form-urlencoded Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 Referer: http://localhost:3000/home Accept-Encoding: gzip, deflate, br Accept-Language: en-US,en;q=0.8,lt;q=0.6



Jayaprakash Kamaraj [Syncfusion]
Replied On June 19, 2017 04:29 AM

Hi Customer, 

Thank you for contacting Syncfusion support. 

The mentioned issue is occurred, due to when the columns bound to the Grid are not defined in the Grid dataSource. We have already discussed the same issue in following knowledge base document.  


Regards, 

Jayaprakash K. 


Me
Replied On June 19, 2017 11:20 AM

Already solved this with that page, but the issue remains - no download is completed. I don't get any errors but none of internet browsers can complete download. I always get the same error: Download failed / server error, thought filename is received but not file. Any idea?

Jayaprakash Kamaraj [Syncfusion]
Replied On June 20, 2017 08:38 AM

Hi Customer, 

We have prepared a sample based on your requirement but we were unable to reproduce the issue at our end. please share the details about issue and we will provide the prompt solution to you. 
 
1.       Grid rendering full code example both client and server. 
2.       Share the video to show the issue. 
3.       Browser details. 
4.       If possible, provide an issue reproducing sample or hosted link or replicate the issue in the attached sample. 

Regards, 

Jayaprakash K. 
 


Me
Replied On June 21, 2017 06:56 AM

Hey,

Attached project with all needed data inside. 'GridModel' (which is passed from Syncfusion) is also hardcoded there.
Usage is pretty simple, just open this link in your browser: http://localhost:57526/list/ExportToExcelGet  - Check port, it might be different for you. Download should occur or fail. Authorization is disabled for testing simplicity, but would be nice to know how I could add headers for export post request too.

How to login, post request:

How to use token (You must add header: Authorization: Bearer access_token) :


P.S. As I said, authentication is disabled, you can see that in controller, but after you make this export work I definitely gonna need to make it work with authorization too.


Me
Replied On June 21, 2017 06:56 AM

Trying to add sample project once again..


Attachment: SyncfusionWebAPISample_a6b0aae1.rar

Me
Replied On June 27, 2017 08:04 AM

Any solution?


Me
Replied On June 29, 2017 03:18 AM

Would be nice to know if you are looking into an issue :)


Jayaprakash Kamaraj [Syncfusion]
Replied On June 29, 2017 11:30 AM

Hi Customer, 

We are sorry for the delay. 

We have analysed your sample and also we have checked your sample with text file downloading (without using Syncfusion Grid Control) that also have the same error (failed-network error). So, we suspect that the issue in your application. So, we suggest you to create a new application and then use grid excel export in that application. After creating new application, If you  face any problem please get back to us. 

Regards, 

Jayaprakash K. 


Me
Replied On June 30, 2017 02:48 AM

As I understand you won't provide source code of your DLLs, so I could see whats wrong there? As at the moment, without seeing your DLL code, I have no clue whats wrong and it's simple Web API RESTful application, recreating won't help, there must be some settings missing or something.


Me
Replied On July 4, 2017 01:23 AM

M? :)


Farveen Sulthana Thameeztheen Basha [Syncfusion]
Replied On July 4, 2017 12:12 PM

Hi Customer, 

We cannot  provide the source code of the DLLs. While checking your application, the issue occurs on normal file downloading  i.e ( without using syncfusion controls)itself. Hence we asked you to create an another application. By resolving that issue, excel file download will work. So please check with your application and get back to us if you need any further assistance. 

Regards, 

Farveen sulthana T 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;