private void okButton_Button_Pressed(object sender, EventArgs e)
        {
            // Check for valid entry
            if ((textBox1.Text.Trim().Length == 0) && (textBox2.Text.Trim().Length == 0))
            {
                MessageBox.Show("You must enter at least one aggregation code.     ", "Invalid Entry",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            // Get the codes
            string code1 = textBox1.Text.Trim();
            string code2 = string.Empty;

            if (code1.Length == 0)
            {
                code1 = textBox2.Text.Trim();
            }
            else
            {
                code2 = textBox2.Text.Trim();
            }

            // Determine the values for the two types
            short onlineSpaceType = 1;

            if (onlineComboBox.SelectedIndex == 1)
            {
                onlineSpaceType = 2;
            }
            short archiveSpaceType = 0;

            if (archiveComboBox.SelectedIndex == 1)
            {
                archiveSpaceType = 1;
            }
            if (archiveComboBox.SelectedIndex == 2)
            {
                archiveSpaceType = 2;
            }
            if (archiveSpaceType == 2)
            {
                onlineSpaceType = 2;
            }

            // Get the file name to save this as
            string filename = String.Empty;

            if ((onlineSpaceType == 2) || (archiveSpaceType == 2))
            {
                DialogResult result = saveFileDialog1.ShowDialog();
                if (result == DialogResult.OK)
                {
                    filename = saveFileDialog1.FileName;
                }
                else
                {
                    return;
                }
            }



            // If archival will be pulled, show patience message
            if (archiveSpaceType > 1)
            {
                MessageBox.Show(
                    "Please be patient as the report is built... this may take some time.        \n\nPress OK to begin report creation.",
                    "Patience", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            Hide();

            // Get the requested report
            DataSet space_utilized = SobekCM_Database.Online_Archived_Space(code1, code2, onlineSpaceType, archiveSpaceType);

            if (space_utilized == null)
            {
                MessageBox.Show("Error pulling the space utilization report from the database.      ", "Database Error",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                if ((onlineSpaceType == 1) && (archiveSpaceType != 2))
                {
                    // Name the report
                    string report_name = code1;
                    if (code2.Length > 0)
                    {
                        report_name = code1 + " intersect " + code2;
                    }

                    string online_space = space_utilized.Tables[0].Rows[0][0].ToString();
                    if ((archiveSpaceType > 0) && (space_utilized.Tables.Count > 1))
                    {
                        string archival_space = space_utilized.Tables[1].Rows[0][0].ToString();
                        MessageBox.Show(
                            "Total online space utilized by " + report_name + ": " + online_space +
                            "\n\nTotal local archived space utilized by " + report_name + ": " + archival_space,
                            report_name + " Space Utilization", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show("Total online space utilized by " + report_name + ": " + online_space,
                                        report_name + " Space Utilization", MessageBoxButtons.OK,
                                        MessageBoxIcon.Information);
                    }
                }
                else
                {
                    if (!write_spreadsheet(filename, space_utilized, code1, code2))
                    {
                        MessageBox.Show("Error writing the space utilization report.      ", "Report Writing Error",
                                        MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show("Space utilization report written.\n\n" + filename + "      ",
                                        "Report Writing Successful", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }

            Close();
        }