veena
June 7, 2012, 9:48am
#1
Hi,
I have deployed the war file given in “http://dhtmlx.com/x/download/regular/grid-excel-java.zip ” in server
and used in the code as follows
var mygrid2;
function doInitGrid(){
mygrid2 = new dhtmlXGridObject(‘mygrid_container2’);
…
…
mygrid2.init();
mygrid2.loadXML(" …");
}
window.onload =doInitGrid;
but the download to excel functionality is not working . Please help me on this
radyno
June 8, 2012, 8:33am
#2
Hi,
does any JavaScript or Java error occur?
By the way:
onclick="mygrid2.toExcel('generate', 'yellow');"
the second parameter is color scheme. It should be one of predefined: full_color, color, gray, bw.
veena
June 8, 2012, 11:14am
#3
Hi,
In my local machine i copied war file given in “http://dhtmlx.com/x/download/regular/grid-excel-java.zip ” and then build the project. When I click on “Get As Excel"button in my localhost I am not able to see anything except a jvascript error"Object doesn’t support this property or method”. I am using JDK1.5.
radyno
June 8, 2012, 2:59pm
#4
Hi,
could you provide me complete demo (without server side, only client)?
veena
June 9, 2012, 10:39am
#5
Hi,
I have attached a sample code i used and the xml
sample.zip (7.4 KB)
radyno
June 11, 2012, 3:41pm
#6
Hi,
please, add method getTitle() into excell price like here:
function eXcell_myprice(cell) {
this.base = eXcell_price;
this.base(cell);
this.setValue = function(val) {
if(val.toString().trim()==""){
val = " ";
this.cell.innerHTML = val;
}
else if (val >= 0){
this.cell.style.color = "green";
val="$"+thousandSeparator(val)+"K";
this.cell.innerHTML = val;
}
else if(isNaN(val)){
val = " ";
this.cell.innerHTML = val;
}
else{
this.cell.style.color = "red";
val="$"+thousandSeparator(val)+"K";
this.cell.innerHTML = val;
}
this.cell.innerHTML = this.grid._aplNF(val, this.cell._cellIndex);
}
this.getTitle = function() {
return this.cell.innerHTML;
};
}
veena
June 12, 2012, 10:34am
#7
Hi,
Thanks a lot. It worked but the header section in the excel is getting repeated at the end of the data in the excel . How can we remove this? and onclick of the button a window also gets opened up. Need to close this window(this is the /generate window) as well. Please help
radyno
June 14, 2012, 9:26am
#8
Hi,
try to update grid-excel-java from here:
viewtopic.php?f=23&t=20151
and file dhtmlxgrid_export.js from attachment.
dhtmlxgrid_export.zip (2.89 KB)