[Bug 68985] Unable to edit cell type on excel file that was generated via Apache Poi API (edit)

2024-05-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=68985

--- Comment #9 from J English  ---
Your recommended solution worked! Thanks again for all your help guys

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 68985] Unable to edit cell type on excel file that was generated via Apache Poi API (edit)

2024-05-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=68985

--- Comment #8 from J English  ---
Yes, the reason is that we import data from a csv file, which stores the data
as comma-delimited String values; thus, when we import the data, all values are
imported as a Strings and I use POI to populate the cells in the order
specified in the csv file. Also, depending my clients, I can have different
variations of excel files, some with multiple numeric columns, which introduces
a layer of unpredictability.

However, I do understand what you mean. In order for a value to be recognized
as a numeric value, I need to parse the value as an integer value before
setting that value for the cell. That makes sense to me. I will give that a
try. Thank you so much for your help. I really appreciate it.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 68985] Unable to edit cell type on excel file that was generated via Apache Poi API (edit)

2024-05-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=68985

--- Comment #7 from sfis...@gmail.com ---
honestly, the real solution is coerce the values going into the cells to
double, that way the underlying framework does not change the cell type to
string.

from reading the javadoc of the various setCellValue( x ) methods, this seems
fairly apparent

is there a reason you are trying to push strings into cells that are being
typed numeric?  

is there a reason you are not parsing/converting/coercing them to numeric
doubles before insertion?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 68985] Unable to edit cell type on excel file that was generated via Apache Poi API (edit)

2024-05-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=68985

--- Comment #6 from J English  ---
PJ, my bad I forgot to answer your original question. Yes, I did try
re-ordering the code by setting the cell type after the cell value, but it
displayed the following data in the excel file, which seemed pretty odd.

0
1
2
3
4

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 68985] Unable to edit cell type on excel file that was generated via Apache Poi API (edit)

2024-05-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=68985

PJ Fanning  changed:

   What|Removed |Added

 Resolution|--- |INFORMATIONPROVIDED
 Status|NEEDINFO|RESOLVED

--- Comment #5 from PJ Fanning  ---
I think you are best off talking to Microsoft. I will close this. There is
nothing in the file generated from POI that prevents you from changing the cell
type in Microsoft Excel.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 68985] Unable to edit cell type on excel file that was generated via Apache Poi API (edit)

2024-05-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=68985

--- Comment #4 from J English  ---
Thank you both for your inputs.

Yes, there are no formulas included the code because I have a customer that
wants to add their own custom formulas to the spreadsheet after the file has
generated.

Also, the is a very slimmed down version of my original code. We normally
import data from a csv file, which stores the data as comma-delimited String
values; thus, when we import the data, all values are imported as a String.

One thing, you might also notice though, and maybe this might be a question for
Microsoft, if you attempt to change the cell type for one of the modified
cells, the change never take effect. I wasn't sure if there was anything in POI
that might be locking the cell type because I am able to update to cell style.
For example, try manually changing the cell type to something random like
'Percentage' and you'll see what I'm referring to. 

Can you please advise if you think the cell type issue might be a POI thing? I
think that if the cell type can be updated, it should resolve the issue with
the manually added formulas.

Thank you

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 68985] Unable to edit cell type on excel file that was generated via Apache Poi API (edit)

2024-05-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=68985

--- Comment #3 from PJ Fanning  ---
*** Bug 68974 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 68985] Unable to edit cell type on excel file that was generated via Apache Poi API (edit)

2024-05-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=68985

--- Comment #2 from Nick Burch  ---
I can't see any formula setting in your code

If you set a formula with POI and we don't evaluate it properly, that's our bug
(or possibly one of our limitations)

If you open a file in Excel, it looks fine, but then Excel doesn't do something
correctly when you make changes to it, that sounds a lot like an Excel bug.

Given that you don't pay us any money, and you presumably do pay Microsoft
quite a bit of money for Excel, I would suggest you report this apparent Excel
bug to the people you have a paid-for support contract with...

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org



[Bug 68985] Unable to edit cell type on excel file that was generated via Apache Poi API (edit)

2024-05-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=68985

PJ Fanning  changed:

   What|Removed |Added

 OS||All
 Status|NEW |NEEDINFO

--- Comment #1 from PJ Fanning  ---
newCell.setCellValue(value);

if value is a String - the cell type is set to string

this will override the setCellType call you made BEFORE the setCellValue

any chance that you could reorder the code to set the type AFTER you set the
value?

I would suggest that you try using a debugger on the code and you will see what
is happening.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org