Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Bricolage: users

generating XLS files with templates

 

 

Bricolage users RSS feed   Index | Next | Previous | View Threaded


D-Beaudet at NGA

Oct 29, 2008, 9:40 AM

Post #1 of 3 (1623 views)
Permalink
generating XLS files with templates

I have some Mason code that works perfectly on our Intranet for
generating XLS files, but when I use that code in a Bricolage template
in my XLS output channel, it results in a corrupted file.



Here's what I'm doing:



<%perl>



use Spreadsheet::WriteExcel::Simple;



# create a new simple spreadsheet object

my $ss = Spreadsheet::WriteExcel::Simple->new;



# write a single row header

$ss->write_bold_row(['venueID']);


#$m->clear_buffer;


$m->print($ss->data);


#$m->abort(200);


</%perl>



I tried to add two lines (currently commented out) as per the Mason FAQ
here



http://www.masonhq.com/?FAQ:Components#h-i_m_trying_to_generate_an_image
_or_other_binary_file__but_it_seems_to_be_getting_corrupted_



but it didn't seem to have an effect.



Anyone have an idea of how to make this work?



Thanks!


bret at pectopah

Oct 29, 2008, 9:47 AM

Post #2 of 3 (1538 views)
Permalink
Re: generating XLS files with templates [In reply to]

Hi David,

What if you put this immediately before the output begins?

$burner->set_encoding('raw');


Hope this helps,

Bret


On Wed, 2008-10-29 at 12:40 -0400, Beaudet, David wrote:
>
> I have some Mason code that works perfectly on our Intranet for
> generating XLS files, but when I use that code in a Bricolage template
> in my XLS output channel, it results in a corrupted file.
>
>
>
> Here's what I'm doing:
>
>
>
> <%perl>
>
>
>
> use Spreadsheet::WriteExcel::Simple;
>
>
>
> # create a new simple spreadsheet object
>
> my $ss = Spreadsheet::WriteExcel::Simple->new;
>
>
>
> # write a single row header
>
> $ss->write_bold_row(['venueID']);
>
>
> #$m->clear_buffer;
>
>
> $m->print($ss->data);
>
>
> #$m->abort(200);
>
>
> </%perl>
>
>
>
> I tried to add two lines (currently commented out) as per the Mason FAQ
> here
>
>
>
> http://www.masonhq.com/?FAQ:Components#h-i_m_trying_to_generate_an_image
> _or_other_binary_file__but_it_seems_to_be_getting_corrupted_
>
>
>
> but it didn't seem to have an effect.
>
>
>
> Anyone have an idea of how to make this work?
>
>
>
> Thanks!
>
--
Bret Dawson
Producer
Pectopah Productions Inc.
(416) 895-7635
bret [at] pectopah
www.pectopah.com


D-Beaudet at NGA

Oct 29, 2008, 9:53 AM

Post #3 of 3 (1539 views)
Permalink
RE: generating XLS files with templates [In reply to]

Bret, thank you so much! That did the trick.

Bricolage users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.