Hi!
So the API seems to be sending down good data now, but i'm still seeing the same error as before on the client when I try to run a report.
I have attached a couple screenshots of what i'm seeing. I'm wondering if it's a casing issue?
API is returning reportData.columns and client is expecting ReportData.Columns.
Just a thought. Let me know if you need more info. Thanks!
Angela Hudson
Senior Software Engineer
Hey Angela, ok great. Thanks for sending the details.
Yes, as you noted, this is because the service is sending data after automatically formatting it in "pascalCase" instead of letting it come back as is. We have actually seen this before in some cases. The fix is to apply "As is case naming" strategy.
So on the service side, you would have to add this in the ReportApiController:
internal class AsIsCaseNamingStrategy : NamingStrategy
{
protected override string ResolvePropertyName(string name)
{
return name;
}
}
And then change the return from "return Ok()" to:
//return Ok(model);
return new JsonResult(model, new JsonSerializerSettings() { ContractResolver = new DefaultContractResolver { NamingStrategy = new AsIsCaseNamingStrategy() } });
Basically this:
It should resolve to "Newtonsoft.Json.Serialization":
Let me know if this helps resolve the issue.
Thanks!
dotnet Report Team