public PDPM_Report_View(PDPM_UI_Plugin ui, String arg) throws Exception
    {
        this.ui = ui;

        // arg is report file name or Date
        if(arg.startsWith("rep-"))
        {
            // File name
            rep_file_name = arg;
        }
        else
        {
            throw new Exception("Report File name should start with \"rep-\"");
        }

        // Check if file exists
        String rep_file_config_path = 
            (String) PDPM_Config_Reader.get_config_param(
                    PDPM_GLOBALS.PDPM_CONFIG_PARAM_PDPM_FILES_PATH);

        if(rep_file_config_path == null)
        {
            rep_file_config_path = "";
        }
        else
        {
            if(rep_file_config_path.endsWith("/") ||
               rep_file_config_path.endsWith("\\"))
            {
            }
            else
            {
                rep_file_config_path = rep_file_config_path + "/";
            }
        }

        rep_file_full_path = rep_file_config_path + rep_file_name;

        // Check if file exists
        try 
        { 
            PDPM_DEBUG.PDPM_REPORTER_LOG("File: " + rep_file_full_path);
            FileReader file = new FileReader(rep_file_full_path);
            input = new BufferedReader(file);
            input.close();
        }   
        catch(FileNotFoundException x)
        {
            PDPM_DEBUG.PDPM_REPORTER_ERR("File not found [" 
                    + rep_file_full_path + "]");
            PDPM_DEBUG.PDPM_REPORTER_ERR(x);
            error = PDPM_ERROR.PDPM_REPORTER_FILE_NOT_FOUND;
            ui.Error("File" + rep_file_full_path + "not found");
            ui.End(get_build_info());
            return;
        } 

        date = rep_file_name.substring(4, 12);

        // Some validity checks
        if(view_format_types.length != view_formatters.length &&
           view_format_types.length != view_format_names.length)
        {
            throw new Exception("Number of View formats supported should match number of report names and number of formatter implementations");
        }
        
        if(patterns.length != pattern_friendly_names.length)
        {
            throw new Exception("Number of patterns and pattern friendly names should match");
        }
        
        // Initialisations
        pattern_values = new String[patterns.length];
        for(int i = 0; i < pattern_values.length; i++)
        {
            pattern_values[i] = null;
        }
    }