Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Hiding cell values via WriteExcel module

Reply
Thread Tools

Hiding cell values via WriteExcel module

 
 
dn.perl@gmail.com
Guest
Posts: n/a
 
      03-09-2009

A quick search of the forum's archives shows that there might be a way
to hide a cell in an excel sheet via win32:le module.
http://groups.google.com/group/comp....43a11cad6139dd

Excel's help for the topic 'Hide or display cell values' suggests that
if a cell's format is set to Number > Custom, and the type is set
to ;;; (three semi-colons), the field is shown blank on the sheet but
the correct value remains associated with the cell. Can this hiding of
the data for a cell or an entire row or an entire column be achieved
through WriteExcel module?

Even if I could *actually* set a column's width to 0 via WriteExcel
module, it would do.
But if I use: set_column('B:B', 0) ; the column B's width is set to
some non-zero default value which Excel seems to calculate internally.

TIA.

 
Reply With Quote
 
 
 
 
smallpond
Guest
Posts: n/a
 
      03-09-2009
On Mar 9, 5:25 pm, (E-Mail Removed) wrote:

>
> Excel's help for the topic 'Hide or display cell values' suggests that
> if a cell's format is set to Number > Custom, and the type is set
> to ;;; (three semi-colons), the field is shown blank on the sheet but
> the correct value remains associated with the cell. Can this hiding of
> the data for a cell or an entire row or an entire column be achieved
> through WriteExcel module?
>


Have you tried it?
$hide_cell = set_num_format(';;;');
$worksheet->write(0, 0, 3.1415926, $hide_cell);
 
Reply With Quote
 
 
 
 
Jim Gibson
Guest
Posts: n/a
 
      03-10-2009
In article
<(E-Mail Removed)>,
<(E-Mail Removed)> wrote:

> A quick search of the forum's archives shows that there might be a way
> to hide a cell in an excel sheet via win32:le module.

[...]
>
> Even if I could *actually* set a column's width to 0 via WriteExcel
> module, it would do.
> But if I use: set_column('B:B', 0) ; the column B's width is set to
> some non-zero default value which Excel seems to calculate internally.


The version of Spreadsheet::WriteExcel on my system (2.25) has a hidden
attribute in the set_column method:

set_column($first_col, $last_col, $width, $format, $hidden, $level,
$collapsed)

with examples:

$worksheet->set_column('D', 20, $format, 1);
$worksheet->set_column('E:E', undef, undef, 1);

Have you tried that?

--
Jim Gibson
 
Reply With Quote
 
smallpond
Guest
Posts: n/a
 
      03-10-2009
On Mar 9, 8:32 pm, Jim Gibson <(E-Mail Removed)> wrote:
> In article
> <(E-Mail Removed)>,
>
>
>
> <(E-Mail Removed)> wrote:
> > A quick search of the forum's archives shows that there might be a way
> > to hide a cell in an excel sheet via win32:le module.

> [...]
>
> > Even if I could *actually* set a column's width to 0 via WriteExcel
> > module, it would do.
> > But if I use: set_column('B:B', 0) ; the column B's width is set to
> > some non-zero default value which Excel seems to calculate internally.

>
> The version of Spreadsheet::WriteExcel on my system (2.25) has a hidden
> attribute in the set_column method:
>
> set_column($first_col, $last_col, $width, $format, $hidden, $level,
> $collapsed)
>
> with examples:
>
> $worksheet->set_column('D', 20, $format, 1);
> $worksheet->set_column('E:E', undef, undef, 1);
>
> Have you tried that?
>
> --
> Jim Gibson


I think that is for hiding formulas rather than values.
 
Reply With Quote
 
Jim Gibson
Guest
Posts: n/a
 
      03-10-2009
In article
<(E-Mail Removed)>,
smallpond <(E-Mail Removed)> wrote:

> On Mar 9, 8:32 pm, Jim Gibson <(E-Mail Removed)> wrote:
> > In article
> > <(E-Mail Removed)>,
> >
> > The version of Spreadsheet::WriteExcel on my system (2.25) has a hidden
> > attribute in the set_column method:
> >
> > set_column($first_col, $last_col, $width, $format, $hidden, $level,
> > $collapsed)
> >
> > with examples:
> >
> > $worksheet->set_column('D', 20, $format, 1);
> > $worksheet->set_column('E:E', undef, undef, 1);
> >
> > Have you tried that?
> >

>
> I think that is for hiding formulas rather than values.


It is for setting default values for columns. From the documentation:

"The $hidden parameter should be set to 1 if you wish to hide a column.
This can be used, for example, to hide intermediary steps in a
complicated calculation:"

Followed by the above examples.

--
Jim Gibson
 
Reply With Quote
 
smallpond
Guest
Posts: n/a
 
      03-10-2009
On Mar 10, 12:37 pm, Jim Gibson <(E-Mail Removed)> wrote:
> In article
> <(E-Mail Removed)>,
>
>
>
> smallpond <(E-Mail Removed)> wrote:
> > On Mar 9, 8:32 pm, Jim Gibson <(E-Mail Removed)> wrote:
> > > In article
> > > <(E-Mail Removed)>,

>
> > > The version of Spreadsheet::WriteExcel on my system (2.25) has a hidden
> > > attribute in the set_column method:

>
> > > set_column($first_col, $last_col, $width, $format, $hidden, $level,
> > > $collapsed)

>
> > > with examples:

>
> > > $worksheet->set_column('D', 20, $format, 1);
> > > $worksheet->set_column('E:E', undef, undef, 1);

>
> > > Have you tried that?

>
> > I think that is for hiding formulas rather than values.

>
> It is for setting default values for columns. From the documentation:
>
> "The $hidden parameter should be set to 1 if you wish to hide a column.
> This can be used, for example, to hide intermediary steps in a
> complicated calculation:"
>
> Followed by the above examples.
>


Sorry. I thought set_column was applying the hidden property to
cells in the column, but it is actually hiding the whole column.
Too many uses of "hidden" in that program.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
WriteExcel module, parsing formula error dn.perl@gmail.com Perl Misc 2 07-08-2009 12:58 AM
WriteExcel module, reopening a file dn.perl@gmail.com Perl Misc 2 12-21-2007 02:51 PM
Can't locate boject methoid Cells via package Sspreadsheet::WriteExcel::Worksheet Pam Perl Misc 7 09-22-2006 11:02 PM
Spreadsheet::WriteExcel Fabio Perl 2 03-04-2004 08:37 AM
Bad excel docs with Spreadsheet::WriteExcel::Simple Erica Perl Misc 2 09-05-2003 08:15 AM



Advertisments