Gossamer Forum
Home : Products : DBMan : Discussions :

easy Excel option

Quote Reply
easy Excel option
I've created a easy excel option for dbman. Enjoy.

#!/usr/local/bin/perl -w

use CGI qw(:standard);
use Spreadsheet::WriteExcel;

$header = "Please Wait Loading";

# Open the file with pipe | separated variables
open (PIPEFILE, "/path/to/default.db");

# Create a new Excel file
my $excel = Spreadsheet::WriteExcel->new("/path/to/webserver/default.xls");

# Row and column are zero indexed
my $row = 0;
my $col;

while (<PIPEFILE>) {
chomp;
# Split on single tab
my @Fld = split('\|', $_);
my $token;

$col = 0;
foreach $token (@Fld) {
# Write number or string as necessary
$excel->xl_write($row, $col, $token);
$col++;
}
$row++;
}

print "Content-Type: text/html\n\n\n";
print("<HTML><HEAD><TITLE>Excel View</TITLE><META HTTP-EQUIV=\"REFRESH\" CONTENT=\"2; url=http://www.yourserver.com/default.xls\"></HEAD> <BODY bgcolor=#ffffff><BR><BR><BR> <FONT COLOR=#000000 ><CENTER><H1>$header</H1></CENTER></FONT><BR>");
print("</body></HTML>");

exit;

Subject Author Views Date
Thread easy Excel option gobucs 6668 Jul 19, 2001, 12:30 PM
Post Re: easy Excel option
LoisC 6534 Jul 20, 2001, 10:41 AM
Thread Re: easy Excel option
Stealth 6525 Jul 20, 2001, 11:11 AM
Thread Re: easy Excel option
Keef 6516 Jul 22, 2001, 11:42 AM
Thread Re: easy Excel option
Stealth 6512 Jul 22, 2001, 9:33 PM
Thread Re: easy Excel option
njh 6514 Jul 24, 2001, 6:46 AM
Thread Re: easy Excel option
Paul 6494 Jul 24, 2001, 8:14 AM
Post Re: easy Excel option
njh 6513 Jul 24, 2001, 8:49 AM
Thread Re: [gobucs] easy Excel option
rdub 5769 May 25, 2005, 7:24 PM
Post Re: [rdub] easy Excel option
JPDeni 5770 May 25, 2005, 8:31 PM