Hello Monks
I'm creating an XLS spreadsheet on a Linux server using Spreadsheet::WriteExcel. It has 12 worksheets and each sheet has different color combinations and URL hyperlinks.
Now I need to convert it to HTML to display it on a webpage. I can do this manually without issue, but when I tried to use Spreadsheet::ParseExcel to automate the process (borrowed from an old monk post) I ended up with an extremely basic display
my $excel_obj = Spreadsheet::ParseExcel->new(); my $workbook = $excel_obj->Parse($outfile); die "Workbook did not return worksheets!\n" unless ref $workbook->{Worksheet} eq 'ARRAY'; for my $worksheet ( @{$workbook->{Worksheet}} ) { print OUT_HTML_FILE "<table>\n"; for my $row ( 0 .. $worksheet->{MaxRow} ) { print OUT_HTML_FILE "<tr>\n"; for my $col ( 0 .. $worksheet->{MaxCol} ) { my $cell = $worksheet->{Cells}[$row][$col]; print OUT_HTML_FILE "<td>"; print OUT_HTML_FILE ref $cell ? $cell->Value : ''; print OUT_HTML_FILE "</td>\n"; } print OUT_HTML_FILE "</tr>\n"; # record ends } print OUT_HTML_FILE "</table>\n"; # worksheet ends }
When I look at the files that Excel produces when I use the "Save As" to an HTML file. It produces a main .htm file plus a link to 12 separate htm files for each worksheet. Within each sheet the HTML seems to be somewhat complex. Can you please let me know if Spreadsheet::ParseExcel would be a good option to try and produce the same .htm files that are produced from the "File Save As" option within Excel?
Thank you very much for your time
In reply to Converting XLS to HTML by dirtdog
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |