Using free Blazor edition. Trying to export custom list to Excel. Object Person doesn't exists in database.
Something like this.
In razor I've created a list
protected override void OnInitialized()
{
List<Person> o = new List<Person>();
Person p = new Person();
p.ID = 1;
p.LastName = "novak";
o.Add(p);
p = new Person();
p.ID = 2;
p.LastName = "second";
o.Add(p);
persons = o.ToList();
}
call Export in same razor file
public void Export(string type)
{
service.Export("Person", type, new Query() { OrderBy = grid.Query.OrderBy, Filter = grid.Query.Filter });
}
in services.cs
public void Export(string table, string type, Query query = null)
//public void Export(IEnumerable table, string type, Query query = null)
{
//navigationManager.NavigateTo(query != null ? query.ToUrl($"/export/{table}/{type}") : $"/export/{table}/{type}", true);
}
After calling I got error,
Sorry, but there's nothing here!
It looks like export expects Table, not object or data recived via WebApi.
Kindly advice