Hello to all readers,
i have an Ultragrid control and i am building the total sum for a column using summarysettings.
that works fine.
UltraCalcManager calc = new UltraCalcManager(); e.Layout.Grid.CalcManager = calc; e.Layout.GroupByBox.Hidden = true; SummarySettings summary = e.Layout.Bands[0].Summaries.Add("G_MENGE" , SummaryType.Sum , e.Layout.Bands[0].Columns[3] , SummaryPosition.UseSummaryPositionColumn); summary.DisplayFormat = "Total = {0}"; ultragrid1.DisplayLayout.Bands[0].SummaryFooterCaption = "Statistik";Now i need a calculated column which computes with the total sum of [col3]. But i don't now how!!!Please help me.
Hi,
I'm afraid I do not understand your question. The code you have here will display the sum of column 3. How is that different htan the "total sum of [col3]"?
By the way, the SummaryType.Sum is a summary type built-in to the grid. You do not need to use a CalcManager for that.
Sorry for my english :(
I want to calculate in col4 with the sum of col3
e.g. value of cell1(col4) * 100 / sum(col3),
cell2(col4) * 100 / sum(col3)
SOLVED: I' using PL/SQL -> ratio_to_report
Hello Sheeeraz001,
I am glad that I was able to help.
If you have any other questions in the future please feel free to let us know.
Hi Danko Valkov
Thanks for reply
I want to access the summary value of a column and your answer works a lot for me.
summarykey( ) is the answer of my question.
Thanks
I have prepared a solution for you. Please take a look at the code below and let me know if this works for you:
public Form1() { InitializeComponent(); DataTable dt = new DataTable(); dt.Columns.Add("Int123", typeof(int)); dt.Columns.Add("Int", typeof(int)); dt.Columns.Add("IntFormula", typeof(int)); dt.Rows.Add(1, 1, 230); dt.Rows.Add(2 ,203, 240); dt.Rows.Add(3,654, 205); dt.Rows.Add(4, 523, 120); dt.Rows.Add(5, 754, 400); dt.Rows.Add(6, 733, 300); dt.Rows.Add(7, 123, 150); dt.Rows.Add(8, 764, 780); dt.Rows.Add(9, 864, 155); ultraGrid1.DataSource = dt.DefaultView; } private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { e.Layout.Bands[0].Summaries.Add("summaryKey", SummaryType.Sum, e.Layout.Bands[0].Columns["Int"]); e.Layout.Bands[0].Summaries["summaryKey"].SummaryPositionColumn = e.Layout.Bands[0].Columns["IntFormula"]; e.Layout.Bands[0].Columns["IntFormula"].Hidden = true; e.Layout.Bands[0].Columns.Add("Unbound"); e.Layout.Bands[0].Columns["Unbound"].DataType = typeof(double); e.Layout.Bands[0].Columns["Unbound"].Header.Caption = "Formula"; e.Layout.Bands[0].Columns["Unbound"].Formula = "[IntFormula]*100/Sum([summaryKey()])"; }
Please feel free to let us know if you have any other questions with this matter.
I have the same issue kindly provide the solution
Hello,
Please let me know if you need any further assistance.