You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2003/05/07 18:38:10 UTC

DO NOT REPLY [Bug 19739] New: - Copied Spreadsheet from Japan can't be opened.

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19739>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19739

Copied Spreadsheet from Japan can't be opened.

           Summary: Copied Spreadsheet from Japan can't be opened.
           Product: POI
           Version: unspecified
          Platform: PC
        OS/Version: Other
            Status: NEW
          Severity: Blocker
          Priority: Other
         Component: HSSF
        AssignedTo: poi-dev@jakarta.apache.org
        ReportedBy: brett.knights@tanner.com


I have a spreadsheet with data originally from Japan. When I tried copying it 
with the source below but the size grows by 3k and I get a message 
saying "Unable to open file" when I try to open the copy.

copy code from a POI example:
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFCell;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;


public class ReadWriteWorkbook
{
    public static void main(String[] args)
        throws IOException
    {
        POIFSFileSystem fs      =
                new POIFSFileSystem(new FileInputStream(args[0]));
        HSSFWorkbook wb = new HSSFWorkbook(fs, true);
        HSSFSheet sheet = wb.getSheetAt(0);

        // Write the output to a file
        FileOutputStream fileOut = new FileOutputStream(args[1]);
        wb.write(fileOut);
        fileOut.close();

    }
}