public function removeFile($filename)
    {

        if (!$filename) {
            trigger_error(ReporticoLang::templateXlate("UNABLE_TO_REMOVE") . templateXlate("SPECIFYXML"), E_USER_ERROR);
            return false;
        }

        if (!preg_match("/\.xml$/", $filename)) {
            $filename = $filename . ".xml";
        }

        $projdir = $this->query->projects_folder . "/" . ReporticoApp::getConfig("project");
        if (!is_file($projdir)) {
            ReporticoUtility::findFileToInclude($projdir, $projdir);
        }

        if ($projdir && is_dir($projdir)) {
            $fn = $projdir . "/" . $filename;
            if (!is_file($fn)) {
                trigger_error(ReporticoLang::templateXlate("UNABLE_TO_REMOVE") . " $filename  - " . templateXlate("NOFILE"), E_USER_ERROR);
            } else if (!is_writeable($fn)) {
                trigger_error(ReporticoLang::templateXlate("UNABLE_TO_REMOVE") . " $filename  - " . templateXlate("NOWRITE"), E_USER_ERROR);
            } else {
                if (!unlink($fn)) {
                    trigger_error(ReporticoLang::templateXlate("UNABLE_TO_REMOVE") . " $filename  - " . templateXlate("NOWRITE"), E_USER_ERROR);
                } else {
                    ReporticoApp::handleDebug(ReporticoLang::templateXlate("REPORTFILE") . " $filename " . templateXlate("DELETEOKACT"), 0);
                }

            }
        } else {
            trigger_error("Unable to open project area " . ReporticoApp::getConfig("project") . " to save file $filename " .
                $this->query->reports_path . "/" . $filename . " Not Found", E_USER_ERROR);
        }

    }