Hi,
i am poovarasan. I am using the grid . What ever is showing in the grid page, i like to export into excel format. When i am cliking the Export hyperlink it has to be ported into Excel. So what i have to do to expotr into excel?
my code
if(buttonName.equals(“Expression”))
cstmt=dbConn.prepareCall("{? = call DiseaseFocus.AltExpression(’"+condnquery+"’ )}");
cstmt.registerOutParameter(1,java.sql.Types.CLOB);
cstmt.execute();
java.sql.Clob test2= cstmt.getClob(1);
cstmt.close();
BufferedReader br = new BufferedReader(test2.getCharacterStream());
while ((aux=br.readLine())!=null)
strOut.append(aux);
report=strOut.toString();
report1=report.replaceAll("’","`");
mygrid = new dhtmlXGridObject(‘gridbox’);
mygrid.hdrSizeA = 300;
mygrid.setImagePath("…/…/…/js/dhtmlxGrid/codebase/imgs/");
mygrid.setSkin(“light”);
mygrid.enableRowsHover(true,‘grid_hover’);
mygrid.init();
mygrid.enableMultiline(true);
mygrid.parse(’<%=report1%>’);
function onKeyPressed(code,ctrl,shift){
if(code==67&&ctrl){
mygrid.setCSVDelimiter("\t")
mygrid.copyBlockToClipboard()
}
if(code==86&&ctrl){
mygrid.pasteBlockFromClipboard()
}
return true;
}
function showClipboard(){
if (window.clipboardData)
document.getElementById(“ser_1”).value = window.clipboardData.getData(“Text”);
}
Regards,
poovarasan
dhtmlxGrid is fully client side component. Exporting grid
to the PDF or Excell file is really server side work. Grid can serialize itself
as XML or CSV - which can be used to further transformation on server side.
Please see example here sales@dhtmlx.com and request for
component customization.