将stringWriter中的内容写入excel,如果超过65536和行怎么办?
java中,将stringWriter中的内容写入excel,如果超过65536行,将会被自动截掉,各位老大有没有什么办法写成多个sheet,部分代码如下:
StringWriter sWriter = new StringWriter();
StringWriter textTarget = new StringWriter();
FormatConverter.convertXML2EXCEL(
new InputStreamReader(new FileInputStream(new File(currDir, "genhtml.xslt ")), "UTF-8 "),
new InputStreamReader(new FileInputStream(new File(currDir.getParent(), "exBodyFoot.xslt ")), "UTF-8 "),
sWriter);
StringReader sReader = new StringReader(sWriter.getBuffer().toString());
FormatConverter.convertXML2EXCEL(
xml, sReader,
textTarget);
sWriter.close();
sReader.close();
binaryOut = response.getOutputStream();
binaryOut.write(textTarget.getBuffer().toString().getBytes( "UTF-8 "));
binaryOut.close();
------解决方案--------------------有没有办法用jxl来做呢,各位高手都来看看那
------解决方案--------------------jxl当然可以做,操作Excel非常简单,但是65536行的限制是没法超过的,多Sheet只需要简单的new个就可以了
------解决方案--------------------如果要写到这么大的话你的机器估计也吃不消了
------解决方案--------------------用poi吧
超過的new 一個sheet