Export Excel

Hi all ,
Urgently I want to export data of gridview to Excel file ..
I see radzen component but not useful because the source code of component not work because

This line of code in component:

public void Export(string type)
{
    service.Export("OrderDetails", type, new Query() { OrderBy = grid.Query.OrderBy, Filter = grid.Query.Filter });
}

Please help

Hi @Ahmed,

I don't understand what the problem is.

I want To know behind code of function (export ) in service
thanks

It is here.

What it does is to navigate to the ExportController which generates the Excel file.

OK, I will Try it
Thanks....

what is northwind refer to

Check the ExportNorthwindController.cs as well.

OK, I will Try it
Thanks Alot @korchev ....

@korchev hi
if gridview contain custom columns , Is Exporting Excel Handle this Case ?
if it not do you have any idea ?
thanks a lot for your Effort ....

No. Exporting generates items for every property of the result query. Check the source implementation.

You can customize the Excel generation as you need it. Again check the source and tweak it as needed.

Thanks A lot @korchev :grin:

Hi korchev, have you noticed that your answers about ExportController and ExportNorthwindController redirect to 404 - page not found?

maybe, you have to update your answers or delete this topic, because, lot of us who were looking for an answer on this topic feel frustrated when we notice that the answer we are looking for to solve the problem has been poorly written.

Thanks

I’ve updated the links in this thread. Two years ago our demos were Blazor server however they are now Blazor WebAssembly and that’s why the location of controllers is different.

Maybe you should get the entire source code to check what and where is defined: