home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hand Held Organizer Toolkit
/
walnutcreekcdrom-handheldorganizertoolkit-march1998.iso
/
PalmPilot
/
support_applications
/
iqreportwizard.zip
< prev
next >
Wrap
Text File
|
1997-12-30
|
7KB
|
212 lines
## IQ Report Wizard series 1 v2.2b: by Nick Smith, Denmark.
## mail: smith@post1.tele.dk
## http://home1.inet.tele.dk/nsa/pilot/
##
##
## I can not be held responsible for any damage occuring to your computer and/or
## programs by using the program. So be bloody carefull!
################################################################################
sub xxx123x1;
@cls = ("cls","cls");
$xxx123x2 = "output.csv";
sub process;
sub xxx123x3;
sub xxx123x4;
sub xxx123x5;
sub xxx123x8;
sub xxx123x6;
open(xxx123x7, ">IQreport.htm") || die ("Couldn't open HTML output file\n!!");
&xxx123x5;
&xxx123x1;
#################################################
#################################################
sub xxx123x8 {
system(@cls);
print("\nEnter the name of your report, this is the long title, \ntype in the name and press ENTER :");
$report_title = <STDIN>;
chop($report_title);
print("\nType in the .PDB file name for your \"$report_title\" database\n\ndo not type in the dot (period)\nor the extension, just the first part: ");
$xxx123x8name = <STDIN>;
chop($xxx123x8name);
$xxx123x8name = $xxx123x8name . "\." . "pdb";
if (-e $xxx123x8name) {
print ("\nI found the PDB file...we will continue..\n");
sleep(1);
}
else {
print("\nThe PDB file you typed, \"$xxx123x8name\" could not be opened!!\n");
print("Make sure you typed the name correctly...\n");
sleep(1);
die ("\nI am quitting now, try again please.\n");
}
print("\nI'm converting the file now...\n");
sleep(1);
@convert = ("jconv.exe","2",$xxx123x8name, $xxx123x2, "data.inf");
system(@convert);
system(@cls);
open(CSVFILE, $xxx123x2)||die("\n\nCouldn't open CSV file for array processing!!\n");
$inputxxx123x11 = <CSVFILE>;
$xxx123x131 = 0;
while ($inputxxx123x11 ne "") {
@xxx123x15[$xxx123x131] = $inputxxx123x11;
$inputxxx123x11 = <CSVFILE>;
$xxx123x131++;
}
close(CSVFILE);
$xxx123x15_size = @xxx123x15;
$xxx123x11 = @xxx123x15[0];
@xxx123x12 = split(/\",\"/,$xxx123x11);
$temp = @xxx123x12[0];
$temp =~ s/"//;
@xxx123x12[0] = $temp;
$fs = @xxx123x12;
$temp = @xxx123x12[$fs-1];
chop($temp);
chop($temp);
@xxx123x12[$fs-1] = $temp;
$fs = 0;
print("\nThese are the database fields numbered:\n\n");
$fs = @xxx123x12;
&xxx123x4(@xxx123x12,$fs, xxx123x7);
$xxx123x13 = 0;
while($xxx123x13 < $fs) {
$number = $xxx123x13+1;
print ("$number: @xxx123x12[$xxx123x13++]\n");
}
print("\nType the number of the field you would like to filter then press ENTER-\n");
print("\n..or, if you do not want to apply a filter, press \"n\" then ENTER: ");
$xxx123x14 = <STDIN>;
chop($xxx123x14);
print("\n");
&process(@xxx123x15,$xxx123x14);
}
sub process {
if ($xxx123x14 eq "n" || $xxx123x14 eq "" || $xxx123x14 eq "N")
{
$total_xxx123x16s = @xxx123x15;
$xxx123x16_xxx123x13er = 1;
while ($xxx123x16_xxx123x13er < $total_xxx123x16s) {
$xxx123x16 = @xxx123x15[$xxx123x16_xxx123x13er++];
@xxx123x9 = split(/\",\"/,$xxx123x16);
$temp = @xxx123x9[0];
$temp =~ s/"//;
@xxx123x9[0] = $temp;
$fs = @xxx123x9;
$temp = @xxx123x9[$fs-1];
chop($temp);
chop($temp);
@xxx123x9[$fs-1] = $temp;
&xxx123x3(@xxx123x9);
}
}
else {
system(@cls);
print("\nNow type in the actual filter to apply. ");
print("\nThis is quite easy. You can type in upper or lower case, \n");
print("\nYou can type all, or just part of the data you want to filter.");
print("\nExample:\n");
print("\nI only want to report people living in Manchester.");
print("\nProviding I have selected the correct field in the previous step,");
print("\nI can type: manch ..and the field will only present data in the");
print("\nreport where the filter text matches the data in the database.");
print("\n\nNOW, TYPE IN YOUR FILTER HERE: ");
$xxx123x17x = <STDIN>;
chop($xxx123x17x);
$total_xxx123x16s = @xxx123x15;
$field_xxx123x13er = 1;
$xxx123x14 = $xxx123x14-1;
while ($xxx123x13er < $total_xxx123x16s) {
$xxx123x11 = @xxx123x15[$xxx123x13er++];
@xxx123x9 = split(/\",\"/,$xxx123x11);
$temp = @xxx123x9[0];
$temp =~ s/"//;
@xxx123x9[0] = $temp;
$fs = @xxx123x9;
$temp = @xxx123x9[$fs-1];
chop($temp);
chop($temp);
@xxx123x9[$fs-1] = $temp;
if (@xxx123x9[$xxx123x14] =~ /$xxx123x17x/i) {
&xxx123x3(@xxx123x9);
}
}
}
}
sub xxx123x4 {
my($xxx123x13);
print xxx123x7 ("\n<H2>$report_title</H2>\n<HR>");
print xxx123x7 ("\n<TABLE WIDTH=\"100%\" BORDER=2><TR>") || die("\nCouldnt do table header");
$xxx123x13 = 0;
while($xxx123x13 < $fs) {
print xxx123x7 ("<TD ALIGN=LEFT><B>@xxx123x12[$xxx123x13++]</B></TD>");
}
print xxx123x7 ("</TR>\n\n");
}
sub xxx123x5 {
print xxx123x7 ("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\">");
print xxx123x7 ("<HTML><HEAD><TITLE>Generated by IQ Report Wizard 2.2b by Nick Smith</title></HEAD>");
print xxx123x7 ("<BODY BGCOLOR=\"#ffffff\" TEXT=\"#000000\" ");
print xxx123x7 ("LINK=\"#0000ff\" VLINK=\"#800080\" ALINK=\"#ff0000\">");
print xxx123x7 ("\n<H3>Generated by IQ Report Wizard 2.2b by Nick Smith</H3><HR>\n");
}
sub xxx123x3 {
$cols = @xxx123x9;
$xxx123x13data = 0;
print xxx123x7 ("\n<TR>");
while ($xxx123x13data < $cols) {
print xxx123x7 ("<TD ALIGN=RIGHT>@xxx123x9[$xxx123x13data++]</TD>");
}
print xxx123x7 ("</TR>");
}
sub xxx123x6 {
local($xxx123x10, $xxx123x11, @xxx123x12, $fs, $xxx123x13, $number);
$xxx123x11 = @xxx123x15[0];
@xxx123x12 = split(/\",\"/,$xxx123x11);
$xxx123x10 = @xxx123x12[0];
$xxx123x10 =~ s/"//;
@xxx123x12[0] = $xxx123x10;
$fs = @xxx123x12;
$xxx123x10 = @xxx123x12[$fs-1];
chop($xxx123x10);
chop($xxx123x10);
@xxx123x12[$fs-1] = $xxx123x10;
$fs = 0;
print("\nThese are the columns numbered:\n\n");
$fs = @xxx123x12;
$xxx123x13 = 0;
while($xxx123x13 < $fs) {
$number = $xxx123x13+1;
print ("$number: @xxx123x12[$xxx123x13++]\n");
}
}
sub xxx123x1 {
system(@cls);
print("Welcome to the IQ (series 1) 2.2b Wizard! : Nick Smith\n");
print("This Report Wizard will guide you through the setup of your database report.\n\n");
print("You will be asked a series of questions about your database and the contents of\n");
print("the report it will generate.\n");
print ("\n\nPress ENTER to contine ...you can quit at anytime by pressing CTRL + C");
$nul = <STDIN>;
system(@cls);
&xxx123x8;
}