#!/bin/bash OUR_PID=$$ # If you run this example from the ordnance/scr/example/nuke directory you will need to run the program with REPORT_DIR option and change directory. REPORT_DIR="examples/nuke" cd ../../ # This is needed to access the Accpac database using the IBM DB2 UDB ODBC connection export DB2INSTANCE=db2inst1 REPORT_SRC="NukeNews.html" REPORT_OUT="News.erf" REPORT_HTML="News.html" REPORT_PS="News.ps" ./GenReport.php "$REPORT_DIR/$REPORT_SRC" $REPORT_OUT ERROR=$? if [ $ERROR -ne 0 ]; then echo "Error trying to generate report" exit 1 fi # The REPORT_OUT is the program that actualy does the connection and populates the data. # You can read it to see what it does but you should delete it for security reasons. #rm -f $REPORT_OUT # If you want you can view the html file or copy it to a web server # konqueror $REPORT_HTML # cp -f $REPORT_HTML /var/www/html/ # If you want to print the report you can convert the html to a PostScript file using html2ps http://user.it.uu.se/~jan/html2ps.html #html2ps -U -f letter.portrate -D -c $REPORT_HTML > $REPORT_PS #kprinter -t "Evaluation Report" -o usletter $REPORT_PS #sleep 5 #rm -f $REPORT_PS #rm -f $REPORT_HTML