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;

Quote Reply
Re: easy Excel option In reply to
Thanks for sharing your mod with all DBMan users

Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: easy Excel option In reply to
Like I mentioned...Mods should be added to the Resources section for easier access. Wink

Regards,

Eliot Lee Wink
http://anthrotech.com/
Quote Reply
Re: easy Excel option In reply to
Hi Eliot

Not everyone visits the 'RESOURCES' section on a daily basis and therfore I am one who thinks that the post should be here as well.

Thanks gobucs!

Keef

Quote Reply
Re: easy Excel option In reply to
The Resources section SHOULD be the first place to search for modification and answers to frequently asked questions...then searching the forums, then posting questions.

While posting a MOD in the Support Forums is fine and dandy, these tend to get lost in the shuffle, that is why I recommend posting it in the Resources section. In addition, the forum search engine does not function as well as the Resources section.

Regards,

Eliot Lee Wink
http://anthrotech.com/
Quote Reply
Re: easy Excel option In reply to
Not everyone can add entries to the resources section. I know I can't - it says I need to register even though I'm (obviously) already registered as a user.

--
Nigel Horne. Arranger, Composer, Conductor, Typesetter.
Quote Reply
Re: easy Excel option In reply to
Yes you can submit resources.

Go here:

http://www.gossamer-threads.com/...er.cgi?signup_form=1

Installations:http://www.wiredon.net/gt/

Quote Reply
Re: easy Excel option In reply to
I get this error at that location after attempting to register:

"The email address you entered is already taken."

--
Nigel Horne. Arranger, Composer, Conductor, Typesetter.
Quote Reply
Re: [gobucs] easy Excel option In reply to
Does this code go in a new cgi file or in one of the existing dbman files?
Quote Reply
Re: [rdub] easy Excel option In reply to
Looks like it's a new file.


JPD
----------------------------------------------------
JPDeni's DBMan-ual
How to ask questions the smart way.