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.

Grid Export - export URL missing controller name

Thread ID:

Created:

Updated:

Platform:

Replies:

130001 Apr 13,2017 12:35 PM Jun 6,2017 08:30 AM ASP.NET Core 6
loading
Tags: Grid
Romain Fabbri
Asked On April 13, 2017 12:47 PM

I'm using syncfusion version 15.1.41 (javascript) and 15.1600.0.41 (EJ and EJ Export)When clicking on the export Excel button (or PDF / word) the URL link is /ExportToExcel instead of /MyController/ExportToExcelAny reason or way to control the URL ?

Romain Fabbri
Replied On April 13, 2017 12:48 PM

Here is the controller source code.
Attachment: Ticket1_50fc62fd.zip

Mani Sankar Durai [Syncfusion]
Replied On April 14, 2017 06:39 AM

Hi Romain, 

Thanks for Contacting Syncfusion support. 

We have analyzed your query and we are not able to reproduce the reported issue. We suspect this the route configuration problem in your application. 
So please check whether the controller and action has been configured correctly in startup.cs page. 

app.UseMvc(routes => 
            { 
                routes.MapRoute( 
                    name: "default", 
                    template: "{controller=Home}/{action=Index}/{id?}"); 
                                     
            }); 
                                                                                                                                               
If you still face the issue please get back to us with the following details. 
1.       Share the startup.cs page from your application. 
2.       Share the video of the issue that you have faced. 
The provided information will help us to analyze the issue and provide you the response as early as possible. 
 
Please let us know if you need further assistance. 

Regards, 
Manisankar Durai 


Romain Fabbri
Replied On April 15, 2017 04:09 AM

I've got the same routing pattern.You can see for yourself...How is the URL built ?Attachment: summer_game_2017_95280780.7z

Jayaprakash Kamaraj [Syncfusion]
Replied On April 17, 2017 04:25 AM

Hi Romain, 
 
To overcome this problem, use Mappers of Grid which is used to modify the default routing path during exporting. By using Mappers, you can use any action name on Controller for exporting and the action can be in any controller (Need not to be in Grid View Page Controller). Please refer to the below code example and sample. 
 
<ej-grid id="FlatGrid" allow-paging="true" datasource="ViewBag.dataSource" export-to-excel-action="/Home/ExportToExcel" export-to-pdf-action="/Home/ExportToPdf" > 
     
    <e-toolbar-settings show-toolbar="true" toolbar-items="@(new List<string>() {"excelExport","pdfExport" })" /> 
    <e-edit-settings allow-editing="true" edit-mode="Batch"></e-edit-settings> 
    <e-columns> 
        <e-column field="OrderID" header-text="Order ID" is-primary-key="true" text-align="Right" width="75"></e-column> 
        <e-column field="CustomerID" header-text="Customer ID" width="80"></e-column> 
        <e-column field="EmployeeID" header-text="Employee ID" text-align="Left" width="75"></e-column> 
        <e-column field="Freight" header-text="Freight" format="{0:C2}" text-align=Right width="75"></e-column> 
        <e-column field="ShipCity" header-text="Ship City" width="110"></e-column> 
    </e-columns> 
</ej-grid> 
 

Regards, 
 
Jayaprakash K. 

 


Frank Hoogmans
Replied On June 5, 2017 08:50 AM

I've seen the same issue arise, and think it has to do with default route values.

When I access my url like "/Members/Index", everything works as expected, but if I access it with "/Members" (and thus, using the default Index action which is defined in the routing config), the export buttons lead me to "/ExportToExcel" instead of "/Members/ExportToExcel".



Jayaprakash Kamaraj [Syncfusion]
Replied On June 6, 2017 08:30 AM

Hi Frank, 

The reported issue has occurred since the URL path wasn’t relative in the project. The action name is to be prepended with the controller name in order to avoid the routing issues. Please refer to the below code example and sample. 

 

<ej-grid id="FlatGrid" allow-paging="true" datasource="ViewBag.dataSource" export-to-excel-action="@Url.Action("ExportToExcel","Home")" export-to-pdf-action="@Url.Action("ExportToPdf","Home")" > 
     
    <e-toolbar-settings show-toolbar="true" toolbar-items="@(new List<string>() {"excelExport","pdfExport" })" /> 
    <e-edit-settings allow-editing="true" edit-mode="Batch"></e-edit-settings> 
    <e-columns> 
        <e-column field="OrderID" header-text="Order ID" is-primary-key="true" text-align="Right" width="75"></e-column> 
        <e-column field="CustomerID" header-text="Customer ID" width="80"></e-column> 
        <e-column field="EmployeeID" header-text="Employee ID" text-align="Left" width="75"></e-column> 
        <e-column field="Freight" header-text="Freight" format="{0:C2}" text-align=Right width="75"></e-column> 
        <e-column field="ShipCity" header-text="Ship City" width="110"></e-column> 
    </e-columns> 

</ej-grid> 

 

Sample: http://www.syncfusion.com/downloads/support/forum/130001/ze/WebApplication8-220979625 

Regards, 

Jayaprakash K. 
 


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.

;