-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
microsoft excel can not parse this odata format? #8
Comments
result message : A missing or empty content type header was found when trying to read a message. The content type header is required |
There is a bug that might cause this and it is fixed in NuGet version 5.1: However, I have not reproduced your issue.
If nothing helps, could you provide more details? It would be helpful if you could call the OData service directly via browser and see what properties are missing. I'm not an expert for Excel OData but not that it might be possible that it requires metadata-full or some specific version of OData (for example v3), or maybe XML version instead of JSON, and that this is causing the issue. |
I experience similar problem and worked out Excel (and power BI desktop as well) requires proper Odata Service document and cdsl metadata to get the data structure first, which aren't provided by this library. @JocaPC, is there any plan to enhance this library to provide Odata Service Document and metadata? |
@Rich-AU @EagleSmith - if you are still interested for this here is example that you can try: https://github.com/JocaPC/sql-server-rest-api/tree/belgrade-odata-min-metadata-api This sample exposes system views The challenge with Excel is that it requires at least OData with min metadata. My service returns no-metadata by default because this is easiest to configure. To enable excel to read data from OData you need to do two additional things:
If URL don't match excel will fail. See setup instructions here: https://github.com/JocaPC/sql-server-rest-api/blob/belgrade-odata-min-metadata-api/README.md I would be happy to try to make setup experience easier if this works fine. Please let me know does it works for your. |
Here is example of OData controller that can provide OData content to Excel and LinqPad in main branch. |
@JocaPC , that's really great! Currently I am working on an example that can dynamically adding controller actions (tables/views) based on configurations in the appsetting.json file - like this : The only thing I still need to work on is to generate proper service document and metadata, your example above does give me a clear direction, thanks a lot! |
return data:
{
"Id": "0101010019 ",
"Barcode": "00182",
"Name": "灏忚嫤鑿\ufffd",
"ItemClsId": "200201 "
}
microsoft can't parse this data ?
The text was updated successfully, but these errors were encountered: