[英]How to create a xls file in titanium appcelerator?
I have to send a report in xls format in my application. 我必须在我的应用程序中以xls格式发送报告。 And it's costly for me to create an API to receive the data and send the xls.
对于我来说,创建一个API来接收数据并发送xls成本很高。 I tried to use some code but all of them is in node.js, and I can't find a CommonJs(module, plugin, etc) for create the xls.
我尝试使用一些代码,但是所有代码都在node.js中,并且找不到用于创建xls的CommonJs(模块,插件等)。
Can someone help me to create the xls in titanium? 有人可以帮助我在钛合金中创建xls吗?
Thanks 谢谢
You didn't mention which libraries you've tested. 您没有提到测试过的库。 This might be one to try out: https://github.com/SheetJS/js-xlsx
这可能是一个可以尝试的方法: https : //github.com/SheetJS/js-xlsx
But does it really need to be a xls file? 但这真的需要一个xls文件吗? If you don't need any styling or special features you could create a cvs file and send this.
如果您不需要任何样式或特殊功能,则可以创建一个cvs文件并将其发送。 Excel will open them and display rows/columns just fine.
Excel将打开它们并显示行/列。
And if it has to be a XSL file you really should look at a server side implementation eg with https://github.com/PHPOffice/PHPExcel . 并且如果必须是XSL文件,则您实际上应该查看服务器端的实现,例如,使用https://github.com/PHPOffice/PHPExcel 。 For the "API" you could just call an URL with GET parameters to pass the data (if it doesn't have to be secure)
对于“ API”,您可以仅调用带有GET参数的URL来传递数据(如果它不一定安全)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.