on 06-08-2009 1:12 PM
Hi all,
In a webdynpro application, we are writing data from webdynpro context to excel sheet using HSSFWorkbook. Below is the code
This works fine when there are only 500 to 600 records .But if there are more than 500-600 records excel gets corrupted and error message is displayed.
While going through different forum I found this is due to encoding. When I comment the for loop in code below, problem doesnu2019t exists any more.Even 10000 records are successfully displayed.
Please guide :
How encoding is causing this problem and how can I rectify this?
What exactly this code (code in bold in below code snippet ) is checking ?
What will be effect if I remove this code as this webdynpro application is used in many countries ?
public byte[] exportFile() throws Exception{
InputStream stream = new ByteArrayInputStream(xslSource);
HSSFWorkbook workbook = new HSSFWorkbook(stream);
stream.close();
process(workbook,true);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
workbook.write(bos);
byte[] retorno = bos.toByteArray();
for(int c=1;c<retorno.length-1;c++){
if(retorno[c-1]==0 && retorno[c]==-125 && retorno[c+1]==1){
retorno[c]=(byte)3;
}else if(retorno[c-1]==63 && retorno[c]==67 && retorno[c+1]!=0){
retorno[c]=(byte)35;
}
}
bos.close();
return retorno;
}
Regards ,
Madhvika
hi
check this blog
/people/subramanian.venkateswaran2/blog/2006/08/16/exporting-table-data-to-ms-excel-sheetenhanced-web-dynpro-binary-cache
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.