title: Print on multiple pages c#
body: <p>I would like to print more pages using c# . in the function printDocument1_PrintPage which prints the document i have:</p>
  
  <pre><code> int values = 0;
   foreach (DataRow row in rows.Rows)
  
              values++;
             if (values &gt; 48)
              {
                  e.HasMorePages = true;
                  values = 0;
              }
              else
              {
                  e.HasMorePages = false;
              }
  </code></pre>
  
  <p>The problem is that it keeps printing pages without stop. How can i keep track of how many rows to print on page ? </p>