westonganger/spreadsheet_architect

ODS column type(s) ineffective

silverdr opened this issue · 5 comments

When creating spreadsheet with AR model objects:

SpreadsheetArchitect.to_ods(
						instances: ar_objects_collection,
						spreadsheet_columns: Proc.new{|instance|
							[
								['Total', :total_amount, :currency],
							]},
					)

the column_type argument (here :currency) seems to have no effect. The same happens if column_types array is given separately. In both cases the column values are formatted as Default.

Gem version checked is 3.2.1, Rails version if 5.0, Ruby version is 2.3.7

I have made some changes in master to resolve this please test and let me know how it goes.

BTW The relevant code is here, feel free to play with it. Create a PR if you have any changes. https://github.com/westonganger/spreadsheet_architect/blob/master/lib/spreadsheet_architect/class_methods/ods.rb#L51-L60

Hmm it appears :percent and :currency do not work in ODS.

The other libraries I checked out do not offer either of these two features and I have an extremely hard time finding the specs and information on the ODS spreadsheet format.

I am going to remove the support for these columns types in ODS. Users can just resort to string formatting instead.

Hi! I am sorry I completely missed your original (fast) response! So.. if things your gem depends on do not support the type, then I find it rather disappointing. Quite a bummer. String formatting is of no use as there are differences in interpretation based on the "locale" settings so for example "1,001" will be understood differently on machines with different setups. OTOH OpenDocument was supposed to be… open so documentation should be available but I'd need to check the validity of this statement myself first.

I would totally appreciate any PRs or any links to understandable documentation regarding ODS spreadsheets.

v3.3.0 has been released which does not support these column types.

Would still love to see some support for this. Please create a new issue if you plan to create a PR or do some work on this. Thanks.