text_wrap on table columns

27 views
Skip to first unread message

Will Reade

unread,
Oct 2, 2015, 11:15:30 AM10/2/15
to Spreadsheet::WriteExcel
I am creating an array of table columns like this.

foreach my $col (@excelcolumns) {
push(@headerexcelcolumns, {header => $fieldname, format => $formatdefault});
}

The $formatdefault variable has $workbook->add_format(num_format => '@', text_wrap => 1).

$worksheet->add_table(
0, 0, $maxrows, $#excelcolumns,
{
columns => \@headerexcelcolumns,
}
);

The table headers aren't wrapping, though. What am I missing?

Thanks in advance!

jmcnamara

unread,
Oct 2, 2015, 11:49:30 AM10/2/15
to Spreadsheet::WriteExcel

Hi Will,

The title says wrapping columns but the question is about wrapping headers. :-)

The format is only applied to the column and not to the header. Text wrap formatting of the column data should work.

Formatting the header isn't supported.

You can work around it by overwriting the column headers with the same name and a format. Something like the following example based on my Python version of the module:

    https://github.com/jmcnamara/XlsxWriter/issues/287

The syntax is similar so you should be able to figure it out. Note, however that spaces in the header are not currently supported (due to a known issue).

John

 

Tonuzi Selim

unread,
Nov 16, 2015, 4:26:02 PM11/16/15
to spreadsheet...@googlegroups.com
Hi,

I create a workbook with multiple worksheets.

There are multiple common columns into each of these worksheets.

Is there a way to apply a filter on one or multiple columns of a worksheet and have it automatically applied to the other worksheets?

Thanks!
S.


jmcnamara

unread,
Nov 17, 2015, 2:53:33 AM11/17/15
to Spreadsheet::WriteExcel, sto...@yahoo.com


On Monday, 16 November 2015 21:26:02 UTC, xodus_fr wrote:
Hi,

I create a workbook with multiple worksheets.

There are multiple common columns into each of these worksheets.

Hi,

Please don't reply to a question with a completely different question. Start a new question instead.

 

Is there a way to apply a filter on one or multiple columns of a worksheet and have it automatically applied to the other worksheets?

If it is possible in Excel it is probably possible in Excel::Writer::XLSX.

If you open a new question please explain how you would do it in Excel and then ask how you would do it in Excel::Writer::XLSX.

John


 

jmcnamara

unread,
Nov 17, 2015, 2:54:54 AM11/17/15
to Spreadsheet::WriteExcel

On Friday, 2 October 2015 16:15:30 UTC+1, Will Reade wrote:
Hi,

In answer to the original question, as of Excel::Writer::XLSX version 0.86 it is now possible to format the headers of a table separately.

John


 
Reply all
Reply to author
Forward
0 new messages