jferard / fastods

A very fast and lightweight (no dependency) library for creating ODS (Open Document Spreadsheet, mainly for Calc) files in Java. It's a Martin Schulz's SimpleODS fork
GNU General Public License v3.0
35 stars 6 forks source link

Add cell content validation #224

Open jferard opened 3 years ago

jferard commented 3 years ago

I convert this message from @AliKantouar into a more generic issue. The menu Data > Validity... allows to check the validty of a user entry (that is, in this context, after the document was generated by FastODS). The relevant item in OpenDocument specification are:

And a few other items.

An example:

<table:content-validations>
    <table:content-validation table:name="val1" table:condition="of:cell-content-is-in-list(&quot;A&quot;;&quot;B&quot;;&quot;C&quot;)" table:allow-empty-cell="true" table:display-list="unsorted" table:base-cell-address="Sheet1.F7">
         <table:error-message table:message-type="stop" table:display="true"/>
    </table:content-validation>
</table:content-validations>

And in the table row:

<table:table-cell table:content-validation-name="val1"/>

Design sketch:

The condition generation will be the hardest part of the job...