I am generating Excel report in Perl.
I am usi开发者_StackOverflowng the Formula in the cell, it's working fine, but in Outlook when I see through preview file, the cell is showing something like Spreadsheet::WriteExcel::Format=HASH(0x87d6d04)
instead of total.
I am using simple forumulas only, like =sum(B1:B10)
or =sum(A1,B2)
.
How to fix this?
outlook excel preview
You probably need to use the write_formula
method rather than the plain write one.
For example,
$worksheet->write_formula(1, 0, '=SIN(B1:B10)');
From the documentation on CPAN for Spreadsheet::WriteExcel
In your code:
$worksheet->write(..., $format05,$font );
You have an unnecessary trailing $font
at the end of that method call which is being passed to write_formula()
(via write()
) as an optional result for the formula.
That is what is showing up as the formula result in Outlook.
精彩评论