在Outlook中的Perl Excel预览问题
我正在用Perl生成Excel报告。
我在单元格中使用公式,它工作正常,但在Outlook中,当我看到预览文件时,单元显示类似Spreadsheet::WriteExcel::Format=HASH(0x87d6d04)
而不是总数。
我只使用简单的论坛,如=sum(B1:B10)
或=sum(A1,B2)
。
如何解决这个问题?
outlookexcel预览
您可能需要使用write_formula
方法而不是普通写入方法。
例如,
$worksheet->write_formula(1, 0, '=SIN(B1:B10)');
从CPAN for Spreadsheet :: WriteExcel的文档
在你的代码中:
$worksheet->write(..., $format05,$font );
在该方法调用结束时,您有一个不必要的尾部$font
,该$font
将作为公式的可选结果传递给write_formula()
(通过write()
)。
这就是Outlook中公式结果显示的内容。