private void generateReportButton_Click(object sender, EventArgs e) { this.SaveReportDialog.ShowDialog(); var filePathInfo = this.SaveReportDialog.FileName; var checkedButton = tabReports.Controls .OfType <RadioButton>().FirstOrDefault(r => r.Checked); UIEngine.CreateReport(checkedButton, filePathInfo); MessageBox.Show("Report created!", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); }