on 05-15-2015 1:46 PM
Hi,
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}"
}
},
]
});
This solved the problem:
{
name : "Süre",
template : {
content : {
parts : [ "Sure" ],
formatter : function(
oValue) {
if (oValue == null)
return oValue;
return oValue + 2;
}
}
}
},
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Efeca, try:
...
content : {
path : "Sure",
formatter : function(oValue){
oValue = oValue + 2;
return oValue;
}
...
Regards,
Pau
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.