This may not be the ideal solution, but did you consider CSV?
If the spreadsheet does not need formulas, writing a CSV file is simple. Its
basically a text file with columns seperated by commas and rows by newlines
(or some varient).
Excel opens CSV files nicely...

On 4/11/07, Katie L. Barbee <[EMAIL PROTECTED]> wrote:

I am really hoping you might be able to help me because I'm not sure
where else to turn.  I am trying to extract information from an Oracle
database into an Excel Spreadsheet for individuals to view and I think
I'm lost.



Project:  When someone logs into an admin area of a site, they would
like to click on a link that says "Get Data" and when clicked on, I
would like for an excel file to be created with the necessary
information.



Below is the Perl file I've written to accomplish this task and well it
doesn't work.  I would prefer not to use a module if possible because I
do not own the server and asking someone to install it would be very
difficult.



In advance, thanks for any help you can offer!  I'm desperate!



CODE:

#!/afs/isis.unc.edu/pkg/perl-582/bin/perl



  use Spreadsheet::WriteExcel::FromDB;



   use Spread

sheet::WriteExcel::FromDB::Query;



  my $dbh =
DBI->connect("dbi:Oracle:oracle.xxx.xxx",'username','password',

           { RaiseError => 0, AutoCommit => 0, LongReadLen => 16384 } )
||

           &do_error("Logging in to database: $DBI::errstr");



  $query = q{'SELECT dateadded, totalpeople, miles, totalsaved FROM
OWNER.Conference ORDER BY dateadded'};

  my $ss = Spreadsheet::WriteExcel::FromDB->read($dbh, $query);



#  my $ss = Spreadsheet::WriteExcel::FromDB->read($dbh,
$Owner.Conference); #  $ss->include_columns(dateadded, totalpeople,
miles, totalsaved);



  print $ss->write_xls('savings.xls');




Reply via email to