功能: 服务端生成完整报告并保护单任务
- 使用 libxlsxwriter 常量内存导出 Excel\n- 增加全局任务占用提示与原始数据持久化\n- 保留运行时任务数据并更新接口文档
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* An example of using the new Excel LAMBDA() function with the libxlsxwriter
|
||||
* library.
|
||||
*
|
||||
* Copyright 2014-2021, John McNamara, jmcnamara@cpan.org
|
||||
*
|
||||
*/
|
||||
|
||||
#include "xlsxwriter.h"
|
||||
|
||||
int main() {
|
||||
|
||||
lxw_workbook *workbook = workbook_new("lambda.xlsx");
|
||||
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
|
||||
|
||||
/* Note that the formula name is prefixed with "_xlfn." and that the
|
||||
* lambda function parameters are prefixed with "_xlpm.". These prefixes
|
||||
* won't show up in Excel.
|
||||
*/
|
||||
worksheet_write_dynamic_formula(worksheet, CELL("A1"),
|
||||
"=_xlfn.LAMBDA(_xlpm.temp, (5/9) * (_xlpm.temp-32))(32)",
|
||||
NULL);
|
||||
|
||||
/* Create the lambda function as a defined name and write it as a dynamic formula. */
|
||||
workbook_define_name(workbook,
|
||||
"ToCelsius",
|
||||
"=_xlfn.LAMBDA(_xlpm.temp, (5/9) * (_xlpm.temp-32))");
|
||||
|
||||
worksheet_write_dynamic_formula(worksheet, CELL("A2"), "=ToCelsius(212)", NULL);
|
||||
|
||||
|
||||
workbook_close(workbook);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user