private void btnExec_Click(object sender, EventArgs e) { // TODO varrer lista de controles, usar as TAGs pra fazer os filtros. StringBuilder filtro = new StringBuilder(); foreach (Control c in panelParams.Controls) { string _and = string.IsNullOrEmpty(filtro.ToString()) ? "" : " AND "; if (c.GetType() == typeof(TextBox)) { TextBox texto = c as TextBox; filtro.AppendLine(_and + texto.Tag.ToString().Replace("@?@", texto.Text)); } if (c.GetType() == typeof(DateTimePicker)) { DateTimePicker data = c as DateTimePicker; filtro.AppendLine(_and + data.Tag.ToString().Replace("@?@", data.Value.ToString("yyyyMMdd"))); } } Report cReport = new Report(); cReport.LOAD(this.RELATORIO.NOME, false); cReport.TABLE.FILTROPARAMETRO = filtro.ToString(); gridWindow grid = new gridWindow(cReport.TABLE.QUERY.ToString(), null); grid.SetGridHeader(cReport.TABLE.FIELDS.TOGRID); grid.showWindow(); }
public void btnAddNew_Click(object sender, EventArgs e) { string novo = "novo relatorio"; int count = 1; for (int i = 0; i < ABAS.TabPages.Count; i++) { if (ABAS.TabPages[i].Text.StartsWith(novo)) { count++; } } novo = novo + count.ToString(); Report.Report report = new Report.Report(); FormatScreen.AddTab(ABAS, novo, report); report.LOAD(novo, true); }