OpenXLSX icon indicating copy to clipboard operation
OpenXLSX copied to clipboard

Add XLStyle support

Open gvollant opened this issue 3 years ago • 14 comments

This PR add XLStyle It contain the original work from https://github.com/troldal/OpenXLSX/issues/104 CEXT see https://github.com/troldal/OpenXLSX/issues/104

gvollant avatar Nov 03 '21 09:11 gvollant

thank you @CEXT-Dan for writing this code

gvollant avatar Nov 03 '21 15:11 gvollant

@troldal I've juste made a rebase against master after 0.3.2 release

gvollant avatar Nov 06 '21 19:11 gvollant

@troldal I made rebase against master

gvollant avatar Jan 08 '22 10:01 gvollant

@troldal what is your idea about this PR?

gvollant avatar Jan 10 '22 21:01 gvollant

There is a function xlsx_formatter in this other library : https://github.com/damian-m-g/xlsx_drone/blob/master/src/xlsx_drone.c

gvollant avatar Jan 19 '22 07:01 gvollant

@damian-m-g , is it a problem for you importing your xlsx_formatter which parse format to "understand" if it is a date on openxlsx ?

gvollant avatar Jan 19 '22 07:01 gvollant

Hi

I’ve done some work on date-time and started on Fonts read only. It’s not done yet though. I added a class OpenXLSX::XLNumberFormat which does a better job at detecting Currency, Percent and Date formatted numbers. (cell.style().numberFormat())

Anyway, you can get the custom format strings from cell.style().formatString() From there one can parse it I.e. [$-10464]dddd,\ mmmm\ d,\ yyyy;

I wrote a parser for my app, not public because it requires non-standard formatting, it wasn’t hard, the only thing weird is excel uses mmmm for month instead of MMMM, so you have to take care when there’s minutes

So kDate Format string = m/d/yy\ h:mm;@ gets weird.

I’m a newb at GIT, so created a branch, so I don’t ruin things, which I’m quite good at. https://github.com/CEXT-Dan/OpenXLSX/tree/feature/Detect_DateTime

I plan on doing a read only border class.

CEXT-Dan avatar Jan 19 '22 08:01 CEXT-Dan

Hello, I suggest you create yourself a pull request after reducing the number of commit https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History

gvollant avatar Jan 22 '22 13:01 gvollant

@troldal @CEXT-Dan I rebased my gvollant:feature/XLStyle branch of this request with all modification from Cext_dan (merged in one commit) I've also added a fix for https://github.com/troldal/OpenXLSX/issues/133 You can both commit on my fork

gvollant avatar Jan 23 '22 10:01 gvollant

@damian-m-g , is it a problem for you importing your xlsx_formatter which parse format to "understand" if it is a date on openxlsx ?

@gvollant feel free to import my code where it's neccessary. Sadly I'm unavailable to take a look at this issue during these days.

damian-m-g avatar Feb 06 '22 06:02 damian-m-g

@damian-m-g I've added code from xlsx_drone on commit https://github.com/troldal/OpenXLSX/pull/111/commits/bd152d289fae74ec0bbe1406a08e10099cffe6f3

@CEXT-Dan your feedback is welcome. We probably need a 'cache' to avoid parsing each style at each cell...

You call all three add commit on my fork

gvollant avatar Mar 02 '22 11:03 gvollant

Hello. If there is a method to make first table column Bold?

MksmOrlov avatar Apr 22 '22 19:04 MksmOrlov

@troldal are you interrested by this feature?

gvollant avatar Jul 24 '22 19:07 gvollant

@gvollant yes, I am indeed. I will eventually get around to it, but I have some other stuff I need to clean up before I proceed. But rest assured, I have not forgotten your PR.

troldal avatar Jul 25 '22 20:07 troldal