1. 程式人生 > >dom4j生成excel複選框

dom4j生成excel複選框

Element row3 = table.addElement(new QName("Row",namespace));
row3.addAttribute("ss:StyleID","s50");
    Element row3cell1 = row3.addElement(new QName("Cell",namespace));
    row3cell1.addAttribute("ss:StyleID","s52");
    row3cell1.addAttribute("ss:Index","2");
        Element row3cell1data1 = row3cell1.addElement("ss:Data");
        row3cell1data1.addNamespace("","http://www.w3.org/TR/REC-html40");
        row3cell1data1.addAttribute("ss:Type","String");
            Element row3cell1data1font = row3cell1data1.addElement(new QName("Font",row3cell1data1.getNamespaceForURI("http://www.w3.org/TR/REC-html40")));
            row3cell1data1font.addAttribute("html:Face","Wingdings");
            row3cell1data1font.setText("首次報告¨þ");

頁面效果如下:

¨:未選

þ:選中