Click here to Skip to main content
15,888,330 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
My questing may be strange (or I chose bad place for ask)...

warning! bad english area, I'm sorry...

Project idea is simple. Sometimes you have to implement spreadsheet-like behavior in your application, but you don't want to use MS Excell via COM or ActiveX either to invent you own bicycle (loosing time and money...), also you may don't want to buy some popular expensive spreadsheet component. I think it will be great to able just to synchronize your favourite UI table component with spreadsheet calculation engine and voila.

I try to make such library (spreadsheet calculation engine). Using it, you will be able to create something like small virtual Excell with several data types, calculable formulas, rows and columns inserting/removing and so on.

Finally, my question:
Does anybody need a such spreadsheet-calculating library? Will it be useless or useful?

P.S. I already have a working alpha version. Here is a sample code:
C++
// raw library calls
SetValueS(10, 10, L"Hello");
SetValueS(10, 11, L"extab!");
SetFormula(10, 12, L"concat(j10;\" \";k10)"); // L"Hello" + L" " + L"extab!"
Calculate();
ReadValue(10, 12); // output: "Hello extab!"

// using wrapper
ExTab xtab;
xtab.SelectTable(xtab.CreateTable());
xtab.Set(1,1,  22.0f); // Change "22.0f" to "22" will cause integer division
xtab.Set(2,1,  7);
xtab.SetFormula(3,1,  L"a1/a2");
xtab.Calculate();
xtab.Get(3,1);
if (xtab.ctype() == EXTAB_VALUE_FLOAT)
    wcout << L"PI is " << *(float*)xtab.cval() << endl;
else
    wcout << L"The result isn't float! Something strange just happened..." << endl;


A also have python sample code if you interested.
Posted
Updated 9-Mar-12 6:58am
v5
Comments
YuriMaks 10-Mar-12 13:27pm    
Ok, I'll be back later :) Work in progress...

1 solution

I think you would get a lot of thankful people that could really use something like this. This, of course, depends on the functionality implemented because that will also determine how useful it is. It might catch on even better if you would provide an easy way to extend it. For example a way to define new functions very easy so it can be extended easily. Most of the time, the hard part with something like this is recalculating the sheet values after a change. This needs to be done properly so it does this efficiently if cells are dependent on each other. Also a mechanism for preventing endless loops needs to be implemented.
So, yes. I do think it could be very valuable if you would create such solid extensible component. Do you already have ideas yourself about how to implement some of the complex features?
 
Share this answer
 
Comments
YuriMaks 9-Mar-12 9:03am    
Yes I have! I already have a demo (not extensible...I'll think about how to implement extensibility) that can:
1) Use 3 basic formulas: IF, SUMM, CONCAT;
2) prevent endless loops;
3) perform mathematical calculations and do data type casting if necessary.
I tested it on Python 2.7 and Win32 console application. Now I want someone will participate in testing, and discussing with me. Where is good place to create thread for conversation about my library?
E.F. Nijboer 12-Mar-12 4:45am    
It could be a good idea to post an article about it here on codeproject. People can post comments and you can start complete discussions if needed. You can explicitly tell people the purpose of your post and that you hope to receive helpful feedback on their findings, any new ideas they have about it, etc... If you just make it clear that the article is about something that isn't completely finished yet they probably all understand and react accordingly.
YuriMaks 15-Mar-12 13:54pm    
Thank you for answering, E.F. Nijboer, I appreciate it :) I will back later with better version of library.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900