Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>By assuming that the records are printed in the details section and the formula for the total is located in the footer section, you get the wrong result because in the <code>for</code> loop you are always reading the last record printed in the details section since the footer in being rendered <strong>after</strong> the details section.</p> <p>As a solution you can use one of the following methods :</p> <ol> <li><p>Solution with 2 formulas.</p> <ul> <li><p>Create a formula called ItemCountDetails and add following code.</p> <pre><code>WhilePrintingRecords; Shared NumberVar Cnt; if RecordNumber = 1 then Cnt:= 0; if {Table_1.Property} = "Laptop" then Cnt:= Cnt + 1; </code></pre></li> <li><p>Drag and drop the formula field somewhere on the details section (where your records will be printed) and suppress it by right clicking on the field -> Format Object -> Common Tab -> and checking the suppress CheckBox.</p></li> <li><p>Create another formula called ItemCountFooter and add the following code.</p> <pre><code>Shared NumberVar Cnt; </code></pre></li> <li><p>Drag and drop the new formula field in the footer section.</p></li> </ul></li> <li><p>Solution with Summary and Grouping.</p> <ul> <li>Right click inside a section and select Summary.</li> <li>From the "Choose the field to summarize" select "Property" which is under Table_1.</li> <li>From the "Calculate this summary" select "count"</li> <li>Click insert group and from the common tab select "Property" from the first ComboBox.</li> <li>Close the dialogs by clicking OK. On the report you will see a field for the name of the group and a field for the count.</li> <li>Right click on the GroupHeaderSection1 bar and select Suppress.</li> <li><p>Right click on the "Count of Table_1.Property" field -> Format Object -> Common Tab -> click the x+2 button which on the right side of the suppress Checkbox and add the following code there</p> <pre><code>if GroupName({Table_1.Property}) &lt;&gt; "Laptop" then true else false </code></pre></li> </ul></li> </ol>
    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.
 

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