poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Woolsey <greg.wool...@gmail.com>
Subject Re: Intended Cell Type
Date Tue, 27 Jun 2017 18:14:58 GMT
Even if you are attempting to just write a validator for some input that is
then used to update/add to a workbook, you may not get what you want
relying on cell formatting.  Excel lets you format an entire column as
numbers, but enter text in whatever cells you want, for things like column
headers.

You may be better served having users define data validation constraints
for specific cells or ranges of cells, and using the code added recently to
POI to evaluate those constraints dynamically as data changes.

On Tue, Jun 27, 2017 at 10:45 AM Murphy, Mark <murphymdev@metalexmfg.com>
wrote:

> I don't think you can restrict what goes in a cell in Excel without using
> VBA. If you need to do that you are better off with a database anyway.
> Besides, VBA cannot be parsed by POI, so even if you do restrict the
> contents of a cell that way, you can't detect it with POI.
>
> -----Original Message-----
> From: Blake Watson [mailto:blake.watson@pnmac.com]
> Sent: Tuesday, June 27, 2017 12:26 PM
> To: POI Users List <user@poi.apache.org>
> Subject: Re: Intended Cell Type
>
> >> but doesn't mean that's what will be written there.
>
> Not in Excel-land. This presents some challenges when you're trying to
> actually restrict what might go there.
>
> >>You could try entering a date and format it as "#,##0.00".
>
> Yeah. And I could format the values according to whats in there, which
> would remove the scientific notation aspect, but which would also put
> commas in exported numbers.
>
> Excel's a hell of a thing.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message