Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As far as I know, I would do it manually via the summary label's BeforePrint event. Calculate the required sum with code, and assign the result to the Text property of the label. This works well if you can explicitly access your datasource in the report (for example if you use IList datasource).</p> <pre><code>private void sumLabel_BeforePrint(object sender, BeforeEventArgs e) { XRLabel lbl = sender as XRLabel; if (lbl == null) return; int sum = myList.Where(item =&gt; item.Result == "P").Sum(item =&gt; item.TotalMarks); lbl.Text = sum; } </code></pre> <p>With another manual solution you could summarize the required values during printing the report by handling the Detail band's BeforePrint event, and then assign the calculated sum to the sum label in its BeforePrint event similarily to above. This approach is more efficient and flexible for more complicated datasources.</p> <pre><code>int currentSum = 0; private void Detail_BeforePrint(object sender, BeforeEventArgs e) { var currentRow = GetCurrentRow() as MyData; if (currentRow == null) return; if (currentRow.Result == "P") currentSum += currentRow.TotalMarks; } private void sumLabel_BeforePrint(object sender, BeforeEventArgs e) { XRLabel lbl = sender as XRLabel; if (lbl == null) return; lbl.Text = currentSum; // invalidate the currentSum for the case of any further report pringing process currentSum = 0; } </code></pre> <p>Unfortunately I don't know about any solution which could be applied purely by designer. Hope it helps.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload