javascript - Grouped JqGrid with summary export -
i export jqgrid excel. , code working fine basic jqgrid want export grouping jqgrid summary each group. not able export data. summary of each group not exported. , not able summary of each group in javascript send manually server.
i use jqgrid client side server side generating excel data posted server excel generation using form submit.
this grid : read border data not export in excel.

and excel file

and export function in javascript :
function fun(){alert("call"); //options = ['xmlstring','grid']; //jquery("#list2").jqgrid('jqgridexport',options); //userdata = jquery("#list2").getuserdata; numberofrecords = $("#list2").getgridparam("records"); var mya=new array(); total = jquery("#list2").jqgrid('footerdata','get'); // last footer data obj2 = jquery("#list2").jqgrid('getcol','amount','array','sum'); group = jqobj.groupfield; mya=jquery("#list2").getdataids(); // ids var data=jquery("#list2").getrowdata(mya[0]); // first row labels var colnames=new array(); var ii=0; var html=""; (var in data){colnames[ii++]=i; html = html +i+"\t";} // capture col names html = html + "\n"; for(i=0;i<mya.length;i++) { data=jquery("#list2").getrowdata(mya[i]); // each row for(j=0;j<colnames.length;j++) { html=html+data[colnames[j]]+"\t"; // output each column tab delimited } html=html+"\n"; // output each row end of line } for(j=0;j<colnames.length;j++) { html=html+total[colnames[j]]+"\t"; // output each column tab delimited } html=html+"\n"; // end of line @ end //document.forms[0].csvbuffer.value = csv alert(html); document.forms[0].csvbuffer.value=html; document.forms[0].method='post'; document.forms[0].action='csvexport.jsp'; // send server open contents in excel file document.forms[0].target='_blank'; document.forms[0].submit(); }
Comments
Post a Comment