Formatter parameter passes as null

I am trying to export table data to an Excel sheet. Everything works OK without formatter. But I have to format some cells before converting table to Excel. I'm debugging the code. Formatter function's parameter passes as null value. Here is my code:

var oExport = new sap.ui.core.util.Export( { exportType : new sap.ui.core.util.ExportTypeCSV( { separatorChar : ";" }), models : this.getView().getModel(), rows : { path : "/FaaliyetServisiSet" }, columns : [ { name : "Kişi", template : { content : "{Klnad}" } }, { name : "Faaliyet", template : { content : "{Falyt}" } }, { name : "Süre", template : { content : { parts : ["Sure"], formatter : function(oValue){ // oValue is null that's the problem !!!!!!! oValue = oValue +2; return oValue; } } } }, { name : "Proje", template : { content : "{Proje}" } }, ] });

-------------Problems Reply------------

I´m facing a similar issue in some data binding use cases. The formatter function gets called with the initial data binding value which can be null or undefined. I circumvent this issue by ignoring calls of the formatter function by simple null and undefined checks.

You should an array of objects instead of strings for the parts

parts: [
{ path: "Sure" }

Category:excel Views:0 Time:2018-05-15

Related post

  • How to Pass MySQL null parameter on DbCommand in Enterprise Library 2008-11-13

    I'm trying to pass a null value for the first parameter in the code below, but MySQL complains that Incorrect number of arguments for PROCEDURE myProc; expected 2, got 1 When I manually call the procedure with the first argument as null, it works, bu

  • VBScript: Passing a parameter with a null value to a stored procedure? 2009-07-21

    In VBScript (ASP environment), is it possible to pass a parameter with a null value to a stored procedure? --------------Solutions------------- Passing null to a stored procedure, using a command object. Set cn = CreateObject("ADODB.Connection") Set

  • Pass a NULL in a parameter to a DateTime field in a stored procedure 2011-03-03

    I have a stored procedure which updates a database using the parameters I supply but I'm having trouble passing a NULL to the stored procedure The field I need to make NULL is a DateTime field DB.Parameters.AddWithValue("@date", NULL) This gives me t

  • Is it okay to pass in NULL to a block parameter? 2011-12-19

    iOS does not scream at me when I pass in NULL or nil to the completion block in animateWithDuration:animations:completion: but does that mean it's okay? Or is it better to open an empty ^{ }? --------------Solutions------------- This is okay as long

  • Invalid length parameter passed to SUBSTRING function 2009-07-21

    Having a bit of a run in with SQL and Transactions... hoping some of you can shine a light on the problem. (and maybe even fix my screwed html! Does this site support formatting for different languages? Perl, SQL, Java?) This server runs on SQL Serve

  • Detect if parameter passed is an array? Javascript 2010-05-04

    Possible Duplicate: How to detect if a variable is an array I have a simple question: How do I detect if a parameter passed to my javascript function is an array? I don't believe that I can test: if (typeof paramThatCouldBeArray == 'array') So is it

  • Query Parameter Value Is Null When Enum Item 0 is Cast with Int32 2010-05-09

    When I use the first item in a zero-based Enum cast to Int32 as a query parameter, the parameter value is null. I've worked around it by simply setting the first item to a value of 1, but I was wondering though what's really going on here? This one h

  • Why doesn't HashTable.Contains() just simply return false if it is passed a null? 2010-06-16

    I understand why passing a null to HashTable.Contains() doesn't work, but I don't understand what the point of it throwing an ArgumentNullException is - instead of just simply returning false? What is the benefit of throwing the exception (other than

  • A question about Parameter passing in c# 2011-01-13

    The below example is got from Jon Skeet's article, "Parameter passing in C#". My question is: Why variable y is NOT null in the first example while we see that it has been changed in the second example: 1- void Foo (StringBuilder x) { x = null; } ...

  • Passing in NULL integer? 2011-02-08

    I have a function that takes in a number of parameters.. it then does a db insert. i have a foreign key on one of the fields (modelID) i want to pass a NULL if no model ID is selected. i tried the following: Dim model As Nullable(Of Integer) If ddlMo

  • Passing in null values to a recursive method 2011-02-22

    I have a method which I want to call itself if a certain condition is true. Initially the method accepts one parameter whose value changes before said condition is reached. public static void Build(string str) { var tree = XmlBuilder.Load(); foreach

  • Data is passing as null from view to controller 2011-09-30

    I have one text box. I have button and I am following T4 MVC Model. In that button, when I try to pass Data like: @Html.Button("submit",Url.Action(MVC.ControllerName.ActionName(paramter),"btnsubmit",.....) In the parameter place, I have pass the text

  • How to pass a null value using name/value pair in xml configuration file? 2011-11-03

    I have to pass a null value for a parameter through an xml configuration file to a function in the following forms but in the value field I have to pass null as the value I an not able to canvass anything on the internet that allows me to pass null p

  • Default Parameter passing in C# 2011-11-08

    Maybe an old question, but am not finding anything comprehensive on the internet. If the default parameter passing method in C# is By value (as per this), then how does it affect the initial Reference Type variable. i.e. In the below example, Why wil

  • What are the Ruby Win32API Parameters | How do I pass a null pointer? 2011-11-11

    I know the following: 'L' - Long 'P' - Pointer 'I' - Integer 'V' - Void My problem is that I can't pass a null pointer when I perform an API call. E.g.: ['L', 'P', 'L'] ->, nil, 0) :: ArgumentError: Null pointer given. My question is: A

  • String Parameter in AjaxOption null on Submit but showing in Response 2012-02-29

    In this piece of code @using (Ajax.BeginForm("MyAction", "MyRouteValues", new AjaxOptions { OnSuccess = "myJSFunction(" + Model.IntegerParameter + ", '" + Model.StringParameter + "')" })) I am wondering why my Javascript recognizes Model.IntegerParam

  • SQL charindex throwing Invalid length parameter passed to the LEFT or SUBSTRING function because of period? 2012-03-30

    I've got the lines below in the where clause of my query, but I keep getting this error: Msg 537, Level 16, State 3, Line 3 Invalid length parameter passed to the LEFT or SUBSTRING function. SUBSTRING( [email], 1, CHARINDEX('@',[email])-1 ) = SUBSTRI

  • Why is my parameter passed by reference not modified within the function? 2008-09-29

    I have got a C function in a static library, let's call it A, with the following interface : int A(unsigned int a, unsigned long long b, unsigned int *y, unsigned char *z); This function will change the value of y an z (this is for sure). I use it fr

  • Parameter passed by const reference returned by const reference 2009-03-20

    I was reading C++ Faq Second Edition , faq number 32.08 . FAQ says that parameter passed by const reference and returned by const reference can cause dangling reference. But it is ok if parameter is passed by reference and returned by reference. I go

  • Autofac parameter passing and autowiring 2009-07-31

    Can't get my head around the parameter passing in Autofac, the following code doesn't work: class Config { public Config(IDictionary<string, string> conf) {} } class Consumer { public Consumer(Config config) {} } void Main() { var builder = new

  • Parameter Passing in Scheme 2010-02-21

    Can anyone help me out understanding the various parameter passing modes in Scheme? I know Scheme implements parameter passing by value. But how about other modes? Is there any good documentation for parameter passing in Scheme? --------------Solutio

  • can a method parameter pass an object by reference but be read-only? 2010-08-08

    C#: can you make it so that a method parameter passes an object by reference but is read-only? eg: void MyMethod(int x, int y, read-only MyObject obj) where obj is an object reference but this object cannot be modified during the method. Can this be

  • Android Parameter Passing Method 2010-08-27

    Which parameter passing method is used in Android? Pass by reference or Pass by Value? Please provide an Android Specific example for the same. --------------Solutions------------- All parameter passing in Java is by value. Here is a nice article wit

  • Instance variables vs parameter passing? Is there an argument? 2010-11-16

    So, I have been working on re-factoring some legacy code recently and have found myself questioning the validity of some of the re-factoring decisions I have been making. One such query has been about the use of instance variables for object sharing

  • How to pass a null value to a data driven unit test from a CSV file? 2010-11-24

    I have a unit test written in c# that uses a .CSV as a datasource: [DataSource("Microsoft.VisualStudio.TestTools.DataSource.CSV", "|DataDirectory|\\TestData.csv", "TestData#csv", DataAccessMethod.Sequential), DeploymentItem("TxRP.Tests\\TestData.csv"

Copyright (C), All Rights Reserved.

processed in 0.486 (s). 12 q(s)