odata

Column level sum/aggregation in SAPUI5 GridTable

我与影子孤独终老i 提交于 2019-12-25 09:19:41
问题 I need to sum/aggregate of finance data at the bottom of Column in SAPUI5 GridTable . I am populating finance data from SAP HANA based odata services but the service can not provide Total at the bottom of data set. Hence my GridTable not showing Total. Can you please provide sample code or idea how I can calculate and show Total in UI5 application? 回答1: You can use method: attachRequestCompleted of the model and then find the sum by looping over the data. 来源: https://stackoverflow.com

OData V4 client adding child entity

Deadly 提交于 2019-12-25 08:49:22
问题 I have a parent (Order) and child (OrderDetail) where Order already exists in the database and OrderDetail also exists in the database. All I really want to do is add another OrderDetail record bound to the Order. I have been down several paths and I'm not even sure what is the correct path. Let's make some assumptions that navigations between these are already working. I can $expand=OrderDetails fine and I can also Orders(1)/OrderDetails fine and do the reverse from OrderDetails. Based on

Restlet createQuery fails with connection error (and after workaround NoSuchMethodError)

喜你入骨 提交于 2019-12-25 08:02:02
问题 I followed the Android restlet tutorial and tried to consume a sample OData webservice (http://services.odata.org/OData/OData.svc/). When I create a query with myService.createProductQuery("/Products"); logcat tells me that ERROR/org.restlet(700): Can't get the metadata for ... A problem similar to this question. I did try and register the Apache client as suggested by Jerome Louvel: Engine.getInstance().getRegisteredClients().clear(); Engine.getInstance().getRegisteredClients().add(new

oData filter not working on navigation property with MongoDB and Web API

∥☆過路亽.° 提交于 2019-12-25 06:46:17
问题 Controller looks like public class NodesRestController : ODataController { private INodeService _nodeService; public NodesRestController(INodeService nodeService) { _nodeService = nodeService; } [EnableQuery()] public IQueryable<Node> Get() { return _nodeService.GetAllNodes(); } [EnableQuery()] public Node Get(string id) { return _nodeService.GetNodeById(id); } } in MongoDb repository i am returning AsQueryable of the collection. //..............Rest of initializations _collection =

Why does oData V4 not order on datetime?

送分小仙女□ 提交于 2019-12-25 06:19:05
问题 I've created a oData V4 endpoint with Web API 2.2 and Entity Framework. The model that is expose looks like the following model: public class Items { public int Id { get; set; } public string Name { get; set; } public DateTime CreatedOn { get; set; } } When I go to the URL: /odata/Items it works like a charm. But when I go to the URL: /odata/Items?$orderby=CreatedOn I get the following error: 'The specified type member 'Kind' is not supported in LINQ to Entities. Only initializers, entity

can we convert Odata metadata to C# code (datacontract)

感情迁移 提交于 2019-12-25 05:38:08
问题 there is a odata webservice, i can get metadata from http://service-uri.com/$metadata which contains definition of all its model object, is there any tools that i can use, to convert that metadata xml to data contract class in C#? 回答1: The WCF Data Services Client library can generate C# classes for you from the $metadata endpoint. These classes won't have the [DataContract] attribute, but you can use them with the rest of the client library to interact with the service. To use this feature,

Query interceptors: Change response status code

岁酱吖の 提交于 2019-12-25 05:31:47
问题 Is it possible to change the HTTP status code returned by WCF Data Services when one of the query interceptors return false? As a bonus, is there a way to selectively return different status codes depending on the query interceptor that failed? 回答1: Could you use something like the following to access the current service method and change the returned HTTP method header information WebOperationContext operationContext = new WebOperationContext(OperationContext.Current); operationContext

Using WCF Data Services 5.6.0 with Entity Framework 6+

不羁的心 提交于 2019-12-25 05:01:16
问题 I have been trying to get our WCF Data Service to work with the new Entity Framework 6. I found this article which explains a supposedly easy and painless way to fix this issue. I followed the directions posted exactly. When I first install: Install-Package Microsoft.OData.EntityFrameworkProvider -Version 1.0.0-alpha1 -Pre I get the error: Error 16 The type 'Microsoft.OData.Service.DataService`1' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft

How to refresh all (OData) bindings of a given SAPUI5 page?

不羁的心 提交于 2019-12-25 04:17:16
问题 I have a bigger SAPUI5 application with multiple pages. If user navigates through all these pages, they will reside in memory of course. Now I have the problem that some of these pages have a complex context with several bindings to an ODataModel. That leads to the problem that a .refresh() call on the underlying ODataModel take some time. Because: all known bindings will be reloaded (also from pages not currently shown) Now I am searching for a better solution to refresh the ODataModel. The

I want to pass the values to label consuming odata

断了今生、忘了曾经 提交于 2019-12-25 03:53:22
问题 since the variables declared(idno, namecity) are inside parentheses I could not access them out side. Is this the way to get values or which would be the best way. Thank You <script> var app = sap.m.App("myApp",{}); var url = "proxy/http/server/ZCUST_TESTING_SRV /?$filter=IKunnr eq '800COL101'"; var username = "mobtest"; var password = "welcome1"; var oModel = new sap.ui.model.odata.ODataModel(url, true, username, password); oModel.read('/', null, null, true, function(oData, oResponse) { var