private void button1_Click_3(object sender, EventArgs e)
{
string connectionString = null;
SqlConnection cnn;
connectionString = "Server = " + AYARLAR.txtServerc + "; Database = " + AYARLAR.txtVeritabanic + "; User Id = " + AYARLAR.txtKullanicic + "; Password = " + AYARLAR.txtParolac;
FileInfo file = new FileInfo(Application.StartupPath + "\\SQL.txt");
string script = file.OpenText().ReadToEnd();
cnn = new SqlConnection(connectionString);
SqlDataAdapter da = new SqlDataAdapter(script, cnn);
da.SelectCommand.Parameters.AddWithValue("@tarih1", dateEdit1.Text);
da.SelectCommand.Parameters.AddWithValue("@tarih2", dateEdit2.Text);
DataTable dt = new DataTable();
da.Fill(dt);
gridControl1.DataSource = dt;
gridView1.ExpandAllGroups();
gridView1.GroupFooterShowMode = GroupFooterShowMode.VisibleAlways;
// Create and setup the first summary item.
GridGroupSummaryItem item1 = new GridGroupSummaryItem();
item1.FieldName = "Odeme Tutari";
item1.SummaryType = DevExpress.Data.SummaryItemType.Sum;
item1.DisplayFormat = "Odeme Tutari {0:c2}";
item1.ShowInGroupColumnFooter = gridView1.Columns["Odeme Tutari"];
gridView1.GroupSummary.Add(item1);
{
//GridView RunTime Gruplama
GridColumn Grupla = gridView1.Columns["Odeme Tipi"];
gridView1.BeginSort();
try
{
gridView1.ClearGrouping();
Grupla.GroupIndex = 0;
}
finally
{
gridView1.EndSort();
}
gridView1.ExpandAllGroups();
}
gridView1.Columns["Odeme Tutari"].SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum;
gridView1.Columns["Odeme Tutari"].SummaryItem.DisplayFormat = "Odeme Toplam = {0}";
gridView1.BestFitColumns();
gridView1.Columns["Odeme Tutari"].DisplayFormat.FormatType = FormatType.Numeric;
gridView1.Columns["Odeme Tutari"].DisplayFormat.FormatString = "c2";
gridView1.Columns["Iade Tutari"].SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum;
gridView1.Columns["Iade Tutari"].SummaryItem.DisplayFormat = "Iade Toplam = {0}";
gridView1.BestFitColumns();
gridView1.Columns["Iade Tutari"].DisplayFormat.FormatType = FormatType.Numeric;
gridView1.Columns["Iade Tutari"].DisplayFormat.FormatString = "c2";
gridView1.Columns["Odeme Tipi"].SortOrder = DevExpress.Data.ColumnSortOrder.Descending;
gridView1.BestFitColumns();
}
{
string connectionString = null;
SqlConnection cnn;
connectionString = "Server = " + AYARLAR.txtServerc + "; Database = " + AYARLAR.txtVeritabanic + "; User Id = " + AYARLAR.txtKullanicic + "; Password = " + AYARLAR.txtParolac;
FileInfo file = new FileInfo(Application.StartupPath + "\\SQL.txt");
string script = file.OpenText().ReadToEnd();
cnn = new SqlConnection(connectionString);
SqlDataAdapter da = new SqlDataAdapter(script, cnn);
da.SelectCommand.Parameters.AddWithValue("@tarih1", dateEdit1.Text);
da.SelectCommand.Parameters.AddWithValue("@tarih2", dateEdit2.Text);
DataTable dt = new DataTable();
da.Fill(dt);
gridControl1.DataSource = dt;
gridView1.ExpandAllGroups();
gridView1.GroupFooterShowMode = GroupFooterShowMode.VisibleAlways;
// Create and setup the first summary item.
GridGroupSummaryItem item1 = new GridGroupSummaryItem();
item1.FieldName = "Odeme Tutari";
item1.SummaryType = DevExpress.Data.SummaryItemType.Sum;
item1.DisplayFormat = "Odeme Tutari {0:c2}";
item1.ShowInGroupColumnFooter = gridView1.Columns["Odeme Tutari"];
gridView1.GroupSummary.Add(item1);
{
//GridView RunTime Gruplama
GridColumn Grupla = gridView1.Columns["Odeme Tipi"];
gridView1.BeginSort();
try
{
gridView1.ClearGrouping();
Grupla.GroupIndex = 0;
}
finally
{
gridView1.EndSort();
}
gridView1.ExpandAllGroups();
}
gridView1.Columns["Odeme Tutari"].SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum;
gridView1.Columns["Odeme Tutari"].SummaryItem.DisplayFormat = "Odeme Toplam = {0}";
gridView1.BestFitColumns();
gridView1.Columns["Odeme Tutari"].DisplayFormat.FormatType = FormatType.Numeric;
gridView1.Columns["Odeme Tutari"].DisplayFormat.FormatString = "c2";
gridView1.Columns["Iade Tutari"].SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum;
gridView1.Columns["Iade Tutari"].SummaryItem.DisplayFormat = "Iade Toplam = {0}";
gridView1.BestFitColumns();
gridView1.Columns["Iade Tutari"].DisplayFormat.FormatType = FormatType.Numeric;
gridView1.Columns["Iade Tutari"].DisplayFormat.FormatString = "c2";
gridView1.Columns["Odeme Tipi"].SortOrder = DevExpress.Data.ColumnSortOrder.Descending;
gridView1.BestFitColumns();
}