private void CreateGrouped()
        {
            ReportComplex report          = new ReportComplex(true, false);
            DataTable     table           = RpProcSheet.GetGroupedTable(date1.SelectionStart, date2.SelectionStart, _listProvNums, _listClinicNums, textCode.Text, checkAllProv.Checked);
            string        subtitleProvs   = ConstructProviderSubtitle();
            string        subtitleClinics = ConstructClinicSubtitle();
            Font          font            = new Font("Tahoma", 9);
            Font          fontBold        = new Font("Tahoma", 9, FontStyle.Bold);
            Font          fontTitle       = new Font("Tahoma", 17, FontStyle.Bold);
            Font          fontSubTitle    = new Font("Tahoma", 10, FontStyle.Bold);

            report.ReportName = Lan.g(this, "Procedures By Procedure Code");
            report.AddTitle("Title", Lan.g(this, "Procedures By Procedure Code"), fontTitle);
            report.AddSubTitle("Practice Title", PrefC.GetString(PrefName.PracticeTitle), fontSubTitle);
            report.AddSubTitle("Dates of Report", date1.SelectionStart.ToString("d") + " - " + date2.SelectionStart.ToString("d"), fontSubTitle);
            report.AddSubTitle("Providers", subtitleProvs, fontSubTitle);
            if (PrefC.HasClinicsEnabled)
            {
                report.AddSubTitle("Clinics", subtitleClinics, fontSubTitle);
            }
            QueryObject query = report.AddQuery(table, Lan.g(this, "Date") + ": " + DateTimeOD.Today.ToString("d"));

            query.AddColumn(Lan.g(this, "Category"), 150, FieldValueType.String, font);
            query.AddColumn(Lan.g(this, "Code"), 130, FieldValueType.String, font);
            query.AddColumn(Lan.g(this, "Description"), 140, FieldValueType.String, font);
            query.AddColumn(Lan.g(this, "Quantity"), 60, FieldValueType.Integer, font);
            query.GetColumnDetail(Lan.g(this, "Quantity")).ContentAlignment = ContentAlignment.MiddleRight;
            query.AddColumn(Lan.g(this, "Average Fee"), 110, FieldValueType.String, font);
            query.GetColumnDetail(Lan.g(this, "Average Fee")).ContentAlignment = ContentAlignment.MiddleRight;
            query.AddColumn(Lan.g(this, "Total Fees"), 110, FieldValueType.Number, font);
            report.AddPageNum(font);
            if (!report.SubmitQueries())
            {
                return;
            }
            FormReportComplex FormR = new FormReportComplex(report);

            FormR.ShowDialog();
            DialogResult = DialogResult.OK;
        }
        private void CreateIndividual()
        {
            ReportComplex report             = new ReportComplex(true, false);
            bool          isAnyClinicMedical = false; //Used to determine whether or not to display 'Tooth' column

            if (AnyClinicSelectedIsMedical())
            {
                isAnyClinicMedical = true;
            }
            DataTable table = new DataTable();

            try {
                table = RpProcSheet.GetIndividualTable(date1.SelectionStart, date2.SelectionStart, _listProvNums, _listClinicNums, textCode.Text,
                                                       isAnyClinicMedical, checkAllProv.Checked, PrefC.HasClinicsEnabled);
            }
            catch (Exception ex) {
                report.CloseProgressBar();
                string          text   = Lan.g(this, "Error getting report data:") + " " + ex.Message + "\r\n\r\n" + ex.StackTrace;
                MsgBoxCopyPaste msgBox = new MsgBoxCopyPaste(text);
                msgBox.ShowDialog();
                return;
            }
            if (table.Columns.Contains("ToothNum"))
            {
                foreach (DataRow row in table.Rows)
                {
                    row["ToothNum"] = Tooth.GetToothLabel(row["ToothNum"].ToString());
                }
            }
            string subtitleProvs   = ConstructProviderSubtitle();
            string subtitleClinics = ConstructClinicSubtitle();
            Font   font            = new Font("Tahoma", 9);
            Font   fontBold        = new Font("Tahoma", 9, FontStyle.Bold);
            Font   fontTitle       = new Font("Tahoma", 17, FontStyle.Bold);
            Font   fontSubTitle    = new Font("Tahoma", 10, FontStyle.Bold);

            report.ReportName = Lan.g(this, "Daily Procedures");
            report.AddTitle("Title", Lan.g(this, "Daily Procedures"), fontTitle);
            report.AddSubTitle("Practice Title", PrefC.GetString(PrefName.PracticeTitle), fontSubTitle);
            report.AddSubTitle("Dates of Report", date1.SelectionStart.ToString("d") + " - " + date2.SelectionStart.ToString("d"), fontSubTitle);
            report.AddSubTitle("Providers", subtitleProvs, fontSubTitle);
            if (PrefC.HasClinicsEnabled)
            {
                report.AddSubTitle("Clinics", subtitleClinics, fontSubTitle);
            }
            QueryObject query = report.AddQuery(table, Lan.g(this, "Date") + ": " + DateTimeOD.Today.ToString("d"));

            query.AddColumn(Lan.g(this, "Date"), 90, FieldValueType.Date, font);
            query.GetColumnDetail(Lan.g(this, "Date")).StringFormat = "d";
            query.AddColumn(Lan.g(this, "Patient Name"), 150, FieldValueType.String, font);
            if (isAnyClinicMedical)
            {
                query.AddColumn(Lan.g(this, "Code"), 140, FieldValueType.String, font);
            }
            else
            {
                query.AddColumn(Lan.g(this, "Code"), 70, FieldValueType.String, font);
                query.AddColumn("Tooth", 40, FieldValueType.String, font);
            }
            query.AddColumn(Lan.g(this, "Description"), 140, FieldValueType.String, font);
            query.AddColumn(Lan.g(this, "Provider"), 80, FieldValueType.String, font);
            if (PrefC.HasClinicsEnabled)
            {
                query.AddColumn(Lan.g(this, "Clinic"), 100, FieldValueType.String, font);
            }
            query.AddColumn(Lan.g(this, "Fee"), 80, FieldValueType.Number, font);
            report.AddPageNum(font);
            if (!report.SubmitQueries())
            {
                return;
            }
            FormReportComplex FormR = new FormReportComplex(report);

            FormR.ShowDialog();
            DialogResult = DialogResult.OK;
        }