Bug 29065 - Loss of Formating and Image when using a template
Summary: Loss of Formating and Image when using a template
Status: RESOLVED WORKSFORME
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 1.0.2
Hardware: Other other
: P3 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-18 16:56 UTC by Bret Gregory
Modified: 2013-08-04 19:47 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bret Gregory 2004-05-18 16:56:51 UTC
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();
>   }
Comment 1 Yegor Kozlov 2008-12-29 09:06:36 UTC
Try the latest POI-3.5-beta4. If the problem persists, re-open this bug and attach the problem file and sample code to reproduce the problem.

Yegor
Comment 2 Dominik Stadler 2013-08-04 19:47:14 UTC
No answer for a long time, set Bug to RESOLVED