Summary: | can't add data validation to excel writen by ms excel 2003 | ||
---|---|---|---|
Product: | POI | Reporter: | rongfu <gaorongfu> |
Component: | HSSF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED WORKSFORME | ||
Severity: | normal | CC: | gaorongfu, schelfdr |
Priority: | P2 | ||
Version: | 3.0-FINAL | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Attachments: |
The main class
The class with the actual code Templates four Template one |
Description
rongfu
2008-06-08 21:04:11 UTC
From what I understand, you created a workbook in Excel 2003, and opened it in POI, then added data validation (by calling HSSFSheet.addValidationData(HSSFDataValidation) etc), and saved. Then when re-opening in Excel, no changes were apparent. Is this correct? It's hard to tell what is going wrong so far, bug it might be worth trying out a recent build, just in case this is a bug which has recently been fixed. If not, please upload the offending (input) spreadsheet and some sample java code to produce this bug. Created attachment 22171 [details]
The main class
Created attachment 22172 [details]
The class with the actual code
To swap between the two templates just change the name of the inputstream.
Also the directory where you place the templates needs to be changed.
Created attachment 22173 [details]
Templates four
This template is just an empty excel with one sheet.
Created attachment 22174 [details]
Template one
The template has some other info in it.
This template gives the follow excel error log after running the code on it :
-----------------------------
Microsoft Excel File Repair Log
Errors were detected in file 'C:\javadev\tools\eclipse-3.3\workspace\ProcExcell\etc\output\procfour.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.
--------------------------
Not mutch usefull info from microsoft :)
I have the same problem as you discribe. So I went and created the a small example code to show that I had this problem also. But when I created the simpel example(template four) and launched it, it worked. But when I did the same thing with an other excel(template one) it seemed to give an error(see comment attachments). I'm not getting this error if there's already a validation in the excell. But when you open the file the validations I tried to add are not there and the validation that was in the template is also gone. The 'template one' that I uploaded here, is without a validation thus with the error. You can add a validation manuel to see what I just told here. Why it works in 'template four' and not in 'template one' I don't know. Maybe with my files you can find out what goes wrong. Try the latest POI 3.5-beta5 no response in a long time => resolving for now, please reopen with more information ifnthis is still an issue |