I have created a Razor Page and accompanying Code Behind which Displays a Blazor Data Grid driven by 2 Blazor Data Pickers. All the events fire correctly such that the Grid Data displays the desired data within the 2 separate Data Picker Values inclusive. My problem is that when I execute the ExportClick functionality which is modeled after all the others with my addition of the values for each of the Data Pickers, the function fails and I get a Page not Found error. All the functions are defined correctly in my DbContext, DbService, and in my code behind. However, it just does not work.
protected override async Task OnInitializedAsync()
{
DateTime d = DateTime.Today.Date;
reportStartDate = new DateTime(d.Year, d.Month - 1, 1);
reportEndDate = d.Date;
retrieveAccountTransactionsByDateRanges = await ApexDbService.GetRetrieveAccountTransactionsByDateRanges(reportStartDate.ToString(), reportEndDate.ToString(), new Query { Filter = $@"i => i.DateEntered.Contains(@0) || i.Source.Contains(@0) || i.Description.Contains(@0) || i.Reference.Contains(@0) || i.Tax.Contains(@0) || i.CurrencyCode.Contains(@0) || i.AccountClass.Contains(@0) || i.AccountType.Contains(@0)", FilterParameters = new object[] { search } });
}
protected DateTime? reportStartDate;
protected DateTime? reportEndDate;
protected async Task ExportClick(RadzenSplitButtonItem args)
{
if (args?.Value == "csv")
{
await ApexDbService.ExportRetrieveAccountTransactionsByDateRangesToCSV(reportStartDate.ToString(), reportEndDate.ToString(), new Query
{
Filter = $@"{(string.IsNullOrEmpty(grid0.Query.Filter)? "true" : grid0.Query.Filter)}",
OrderBy = $"{grid0.Query.OrderBy}",
Expand = "",
Select = string.Join(",", grid0.ColumnsCollection.Where(c => c.GetVisible()).Select(c => c.Property))
}, "RetrieveAccountTransactionsByDateRanges");
}
if (args == null || args.Value == "xlsx")
{
await ApexDbService.ExportRetrieveAccountTransactionsByDateRangesToExcel(reportStartDate.ToString(), reportEndDate.ToString(), new Query
{
Filter = $@"{(string.IsNullOrEmpty(grid0.Query.Filter)? "true" : grid0.Query.Filter)}",
OrderBy = $"{grid0.Query.OrderBy}",
Expand = "",
Select = string.Join(",", grid0.ColumnsCollection.Where(c => c.GetVisible()).Select(c => c.Property))
}, "RetrieveAccountTransactionsByDateRanges");
}
}
Would it be possible for you to see an error as I have been looking at this for many hours? I am sure that it should be a simple error but I just can't find it, ugh.