cxn03651 / write_xlsx

Rubygem for create excel xlsx file
http://cxn03651.github.io/write_xlsx/
MIT License
287 stars 64 forks source link

worksheet.write method gives excepiton with: 255 characters, it exceeds Excel's limit for URLS. #36

Open ismailakbudak opened 6 years ago

ismailakbudak commented 6 years ago

Hi,

When I try to write xlsx with worksheet.write method, It tries to write with worksheet.write_url method for long string that is start with https:// and it gives exception: 255 characters, it exceeds Excel's limit for URLS.

Exceptional example text:

https://www.example.com Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

So I changed my method with worksheet.write_string, but then when I try to write integer value with this method It gives me another exception:

irb(main):001:0>  worksheet.write_string(0, 0, 1)
ArgumentError: wrong number of arguments (given 2, expected 1)

When you try with string there is no exception

irb(main):001:0>  worksheet.write_string(0, 0, "1")

I think worksheet.write_string method should have str.to_s in default.

cxn03651 commented 6 years ago

Thank you for using write_xlsx.

Your idea is very nice. I'll do it in next version.