justkawal / excel

Excel Library for Flutter and Dart - https://pub.dev/packages/excel
MIT License
426 stars 239 forks source link

Type Formula not recognized when it returns String #74

Open bbjay opened 3 years ago

bbjay commented 3 years ago

Hi, thanks for creating this amazing library!

I've found one issue when accessing formulas of cells: When a formula of a cell returns a String, like in =IF(1,"1","0") the cell gets parsed as a String, not as a Formula object.

If the formula returns plain numbers, like in =IF(1,1,0) it is correctly parsed as a Formula object.

My concrete use case is a bit different, where i have a cell with a formula that generates text: ="Some text with value from cell "&A5&" with other text" and i would like to access the Formula to insert the value myself at runtime.

I've had a short look at parse.dart https://github.com/justkawal/excel/blob/b43e587796b7d0f45450b9e81f584eca76b03dc1/lib/src/parser/parse.dart#L497 and it looks like the issue could lie not in the parser, but in the way Excel saves such cells. Not entirely sure tough, as i not fully understand what is going on there...

Maybe you have a better idea whats going on in this case?

justkawal commented 3 years ago

@bbjay Thanks for this issue, Sorry for late response, As was stuck into Covid-19.

I will look it into week-ends as I'll will be free from my day-job.

sashwini commented 3 years ago

@justkawal any update on this formula issue. I am trying to read a file which can have formula. After reading the formula, I need the value. After moving to null safety version, value is not available.

P.S. I am using excel files created by end user and will be processed by my web app.

justkawal commented 3 years ago

Sorry for late response,

I know these functionalities are important. Right now, I'm trying to focus on my day job in these hard-times in India.

It's very tough to earn these days in India.

Contributions are welcome, Thanks for understanding.

Joseph-Nathan commented 2 years ago

any news ?