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 2004/05/18 18:56:52 UTC
DO NOT REPLY [Bug 29065] New: -
Loss of Formating and Image when using a template
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=29065>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=29065
Loss of Formating and Image when using a template
Summary: Loss of Formating and Image when using a template
Product: POI
Version: 1.0.2
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: Other
Component: HSSF
AssignedTo: poi-dev@jakarta.apache.org
ReportedBy: bret.gregory@accesspointinc.com
CC: danny@muibros.com
I ran into a proble when trying to create a new worksheet off of a template
which contains an image and some formatting in POI v2.5. I was not able to
recreate the problem in POI 2.0 RC2.
Below is the message that I posted to the User Mailing List describing the
problem in more detail and also showing the example code that I used.
> Basically, I have a test case that attempts to modify one cell in the
> new worksheet. When I attempt to open the newly created file it gives
> me an error that Microsoft attempted to repair the file. Here is a
> copy of the
> log:
>
>
> Errors were detected in file
> 'C:\API_RECON\test_data\excel_manipulation_test.xls'
> The following is a list of repairs:
>
> Damage to the file was so extensive that repairs were not possible.
> Excel attempted to recover your formulas and values, but some data
> may have been lost or corrupted.
>
> The file opens, but all the formatting is gone and the image is not
> displayed. Is anyone else having this problem? Any help is much
> appreciated.
>
>
> Here is my test code:
>
> public ExcelTest() {
>
> try {
> FileInputStream file = new
> FileInputStream("C:\\API_RECON\\test_data\\Reconciliation_Report_Templ
> ate.xl
> t");
> HSSFWorkbook wb = new HSSFWorkbook(file, true);
> HSSFSheet sheet = wb.getSheetAt(0);
> HSSFRow title_row = sheet.getRow(3);
> HSSFCell title_cell = title_row.getCell((short)0);
> title_cell.setCellValue("TEST TEST TEST");
>
> FileOutputStream out = new
> FileOutputStream("C:\\API_RECON\\test_data\\excel_manipulation_test.xls");
> wb.write(out);
> out.close();
>
> } catch (FileNotFoundException fnf) {
> fnf.printStackTrace();
> } catch (IOException ioe) {
> ioe.printStackTrace();
> }
> }
>
> public static void main(String[] args) {
> new ExcelTest();
> }
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-dev-help@jakarta.apache.org