private void buttonAccountSearch_Click(object sender, EventArgs e) { ClearError(); if (string.IsNullOrEmpty(textBoxAccountSearch.Text)) { errorProviderAccount.SetError(textBoxAccountSearch, "Info Required"); DataTable dataTable = sqLGetData.AccountList(); DataGridViewAccount(dataTable); } else { GetUserInput(); DataTable dataTable = sqLGetData.AccountSearch(account_UI.AccountSearch.Trim()); DataGridViewAccount(dataTable); } }
public FormAccountReport(bool Mode) { InitializeComponent(); if (Mode == true) { System.Drawing.Printing.PageSettings pageSettings = new System.Drawing.Printing.PageSettings(); SettingPagePotrait(pageSettings); reportAccountDetail.SetPageSettings(pageSettings); DataTable dataTable = sqLGetData.AccountSearch(FormAccount.Forms.textBoxAccountID.Text); reportAccountDetail.LocalReport.DataSources.Clear(); reportAccountDetail.LocalReport.DataSources.Add(new ReportDataSource("ReportDataSet", dataTable)); reportAccountDetail.LocalReport.ReportEmbeddedResource = "ArlixAJP.Account.ReportAccountDetail.rdlc"; ReportParameter[] reportParameters = new ReportParameter[4]; reportParameters[0] = new ReportParameter("ReParCompName", Properties.Settings.Default.CompName, true); reportParameters[1] = new ReportParameter("ReParCompAddress", Properties.Settings.Default.CompAddress, true); reportParameters[2] = new ReportParameter("ReParCompPhone", Properties.Settings.Default.CompPhone, true); reportParameters[3] = new ReportParameter("ReParCompEmail", Properties.Settings.Default.CompEmail, true); reportAccountDetail.LocalReport.SetParameters(reportParameters); reportAccountDetail.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.PrintLayout); reportAccountDetail.RefreshReport(); } else { System.Drawing.Printing.PageSettings pageSettings = new System.Drawing.Printing.PageSettings(); SettingPageLandScape(pageSettings); reportAccountDetail.SetPageSettings(pageSettings); DataTable dataTable = sqLGetData.AccountList(); reportAccountDetail.LocalReport.DataSources.Clear(); reportAccountDetail.LocalReport.DataSources.Add(new ReportDataSource("ReportDataSet", dataTable)); reportAccountDetail.LocalReport.ReportEmbeddedResource = "ArlixAJP.Account.ReportAccount.rdlc"; ReportParameter[] reportParameters = new ReportParameter[4]; reportParameters[0] = new ReportParameter("ReParCompName", Properties.Settings.Default.CompName, true); reportParameters[1] = new ReportParameter("ReParCompAddress", Properties.Settings.Default.CompAddress, true); reportParameters[2] = new ReportParameter("ReParCompPhone", Properties.Settings.Default.CompPhone, true); reportParameters[3] = new ReportParameter("ReParCompEmail", Properties.Settings.Default.CompEmail, true); reportAccountDetail.LocalReport.SetParameters(reportParameters); reportAccountDetail.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.PrintLayout); reportAccountDetail.RefreshReport(); } }