Project Online: OData–refreshing reports when changing languages


Thanks to Alex Silva for suggesting this posting – following hot on the heels of the reserved word post

This relates to the differences seen when retrieving reports with OData in different languages.  In the previous post I showed how you could get different results by inserting the [LCID String] such as [pt-BR] to get Brazilian Portuguese – but you can also get local language results if your browser language and Office 365 language settings are set.  For example a user set for Portuguese Brazilian will see their local language (Projetos rather than Projects) even when not including [pt-BR].  This then gives an issue when an administrator sets up a report that uses a ‘generic’ Url to the _api/ProjectData endpoint – that if different users try to refresh the report it may be trying to select different data.  If I as a pt-BR user try and refresh a report that is looking for ‘Projects’ then I will get an error.  In English the error would be Resource not found for the segment 'Projects'.

The solution to this is that the reports should always be set with an explicit language so that the various endpoints, filters and selections will always work as they would be using the matching local language version of the field names.  So setting the Url to be .sharepoint.com/sites/pwa/_api/ProjectData/[en-US]/Projects">https://<yourdomain>.sharepoint.com/sites/pwa/_api/ProjectData/[en-US]/Projects would correctly refresh whatever the local language of the user.  Obviously it does not have to be en-US – just choose the language most of the users of this report will be using – or alternatively create a set of reports in the different languages your users wish to consume.

image 

Comments (0)

Skip to main content