Answers.Body: <p>OK for others searching this is what I found works</p>
  
  <pre><code> $sections = array ( 'mybreakcolumn' =&gt; array (
                    'title' =&gt; 'Rep Name',
                    'type' =&gt; 2,
                    'section' =&gt; 1,
                    'pageBreak' =&gt; 1,
                    ));
  
                    $this-&gt;assign('sections', $sections);
  </code></pre>
  
  <p>Where mybreakcolum is the full column name sent to the template</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-08-21T17:48:38.087Z
Answers.Text: Thanks very much for following up and answering your own question! This just helped me out.
Answers.UserDisplayName: Eli Lisseck
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-09-26T09:07:29.837Z
Answers.LastActivityDate: 2016-09-26T09:07:29.837Z
Answers.UserDisplayName: Alan Fuller
Body: <p>I'm trying to work out how this is done,  it seems the standard templates have this coded in</p>
  
  <pre><code>{$l}if $sections.{$column}.type &amp; 4{$r}
                      {$l}assign var=printValue value=$row.{$column}|crmDate{$r}
                  {$l}elseif $sections.{$column}.type eq 1024{$r}
                      {$l}assign var=printValue value=$row.{$column}|crmMoney{$r}
                  {$l}else{$r}
                      {$l}assign var=printValue value=$row.{$column}{$r}
                  {$l}/if{$r}
                  {$l}if $rowid neq 0{$r}
                    {if $section.pageBreak}
                      {$l}if $pageBroke &gt;= {$h} or $pageBroke == 0{$r}
  </code></pre>
  
  <p>And I know the extended reports extension implements this.</p>
  
  <p>I have been looking at the code, but it is very generic, in that it allows selecting sort fields &amp; selecting section / page breaks.   But I can't yet fathom out what I need for my simple use case ( I don't need user selectable option - just want to break on a sort field )</p>
  
  <p>I'm hoping it is something straight forward  <code>$this-&gt;_sections</code> but I am floundering around a bit.</p>
  
  <p><code>$this-&gt;assign('sections', $this-&gt;_sections);</code></p>
  
  <p>Any help or pointers to example much appreciated.</p>
  
  <p>--- edit  ---  this is where I have got to</p>
  
  <pre><code>function orderBy() {  $this-&gt;_orderBy = "ORDER BY mycolumn";
  
                    $sections = array ( 'my_section' =&gt; array (
                    'title' =&gt; 'My Name',
                    'type' =&gt; 2,
                    'tplField' =&gt; 'mytable_mycolumn',
                    'section' =&gt; 1,
                    'pageBreak' =&gt; 1,
                    ));
  
                    $this-&gt;assign('sections', $sections);
  
                   }
  </code></pre>
  
  <p>Whilst it is promising, in that it puts out the at least the text of the first section and it doesn't fail or shout warnings, it just doesn't present any values?</p>
  
  <p>I have tried combinations of mytable_myfield / myfield in tplField and columns.</p>
  
  <p>I have compared smarty debug variables between working versions and mine, and I haven't got it yet.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-09-26T08:30:35.703Z
Comments.Text: Any one with a bit more experience in smarty templates help here?
  
  Trying to understand the basics of teh template section header loop in report/form/layout/Table.tpl  but right now struggling slightly
Comments.UserDisplayName: Alan Fuller
Tags: <custom-reports>
Title: Section and Page Breaks in Reports
ThreadText: # Section and Page Breaks in Reports
  
  (Asked by: username_0 on 2016-09-23)
  
  I'm trying to work out how this is done,  it seems the standard templates have this coded in
  {$l}if $sections.{$column}.type & 4{$r}
                      {$l}assign var=printValue value=$row.{$column}|crmDate{$r}
                  {$l}elseif $sections.{$column}.type eq 1024{$r}
                      {$l}assign var=printValue value=$row.{$column}|crmMoney{$r}
                  {$l}else{$r}
                      {$l}assign var=printValue value=$row.{$column}{$r}
                  {$l}/if{$r}
                  {$l}if $rowid neq 0{$r}
                    {if $section.pageBreak}
                      {$l}if $pageBroke >= {$h} or $pageBroke == 0{$r}
  
  And I know the extended reports extension implements this.
  I have been looking at the code, but it is very generic, in that it allows selecting sort fields & selecting section / page breaks.   But I can't yet fathom out what I need for my simple use case ( I don't need user selectable option - just want to break on a sort field )
  I'm hoping it is something straight forward  $this->_sections but I am floundering around a bit.
  $this->assign('sections', $this->_sections);
  Any help or pointers to example much appreciated.
  --- edit  ---  this is where I have got to
  function orderBy() {  $this->_orderBy = "ORDER BY mycolumn";
  
                    $sections = array ( 'my_section' => array (
                    'title' => 'My Name',
                    'type' => 2,
                    'tplField' => 'mytable_mycolumn',
                    'section' => 1,
                    'pageBreak' => 1,
                    ));
  
                    $this->assign('sections', $sections);
  
                   }
  
  Whilst it is promising, in that it puts out the at least the text of the first section and it doesn't fail or shout warnings, it just doesn't present any values?
  I have tried combinations of mytable_myfield / myfield in tplField and columns.
  I have compared smarty debug variables between working versions and mine, and I haven't got it yet.
  
  **Tags:** custom-reports
  
  > **Comments:**
  > **username_0**: Any one with a bit more experience in smarty templates help here?  Trying to understand the basics of teh template section header loop in report/form/layout/Table.tpl  but right now struggling slightly  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2016-09-26. Score: 1
  
  OK for others searching this is what I found works
   $sections = array ( 'mybreakcolumn' => array (
                    'title' => 'Rep Name',
                    'type' => 2,
                    'section' => 1,
                    'pageBreak' => 1,
                    ));
  
                    $this->assign('sections', $sections);
  
  Where mybreakcolum is the full column name sent to the template
  
  > **Comments:**
  > **username_1**: Thanks very much for following up and answering your own question! This just helped me out.  
  
  ---
  
  