有人需要电子表格计算库吗? [英] Does anybody need a spreadsheet-calculating library?

查看:83
本文介绍了有人需要电子表格计算库吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的询问可能很奇怪(或者我选择了不好的地方去询问)...

警告!英语区域不好,很抱歉...

项目的想法很简单.有时您必须在应用程序中实现类似电子表格的行为,但是您不想通过COM或ActiveX使用MS Excell来发明自己的自行车(浪费时间和金钱...),您可能也不想这样做.''不想购买一些流行的昂贵电子表格组件.我认为将您最喜欢的UI表组件与电子表格计算引擎和voila同步将是很棒的.

我尝试制作这样的库(电子表格计算引擎).使用它,您将能够创建具有多个数据类型,可计算公式,行和列的插入/删除等的小型虚拟Excell.

最后,我的问题:
有人需要这样的电子表格计算库吗?它会没有用还是有用?

P.S.我已经有一个工作的Alpha版本.这是示例代码:

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:

// 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;



如果您有兴趣,也可以使用python示例代码.



A also have python sample code if you interested.

推荐答案

我认为您会得到很多感激的人,他们真的可以使用类似的东西.当然,这取决于所实现的功能,因为这也将决定其有用性.如果您提供一种扩展它的简便方法,它可能会变得更好.例如,一种非常容易定义新功能的方法,因此可以轻松地对其进行扩展.在大多数情况下,类似这样的难题是更改后重新计算工作表值.这需要正确完成,因此如果单元格相互依赖,则可以有效地做到这一点.另外,需要实现用于防止无限循环的机制.
所以,是的.我确实认为,如果您要创建这样一个可靠的可扩展组件,那将非常有价值.您是否已经对如何实现某些复杂功能有自己的想法?
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?


这篇关于有人需要电子表格计算库吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆