title: Python - Reportlab: Why do SPAN for more than two rows at the second page returns error?
body: <p>I'm generating a table that is long enough to go onto second page. What I would like to achieve is to SPAN 4 rows on the second page. I do it using the follwing code in the TableStyle.</p>
  
  <pre><code>('SPAN', (0,38), (0,41))
  </code></pre>
  
  <p>Span for two rows works though. ('SPAN', (0,38), (0,39))</p>
  
  <p>Here's a code:</p>
  
  <pre><code>#!/usr/bin/env python
  # -*- coding: utf-8 -*-
  
  from reportlab.platypus import SimpleDocTemplate, Table, LongTable, TableStyle, BaseDocTemplate, Frame, Paragraph, NextPageTemplate, PageTemplate
  from reportlab.lib.pagesizes import letter, inch
  from reportlab.lib import colors
  
  def testPdf():
      doc = BaseDocTemplate("testpdf.pdf",pagesize=letter,
                          rightMargin=72,leftMargin=72,
                          topMargin=72,bottomMargin=18, showBoundary=True)
      width, height = letter
      print width 
      print height
  
      elements = []
      datas = []
      for x in range(1,50):
          datas.append(
              [x,x+1]
          )
      t=LongTable(datas)
  
      tTableStyle=[
          ('SPAN', (0,38), (0,41)),
          ('INNERGRID', (0,0), (-1,-1), 0.25, colors.black),
          ('BOX', (0,0), (-1,-1), 0.25, colors.black),
      ]
      t.setStyle(TableStyle(tTableStyle))
      elements.append(t)
  
      frameT = Frame(doc.leftMargin, doc.bottomMargin, doc.width, doc.height, id='normal')
  
      doc.addPageTemplates([PageTemplate(id='OneCol',frames=frameT)])
  
      doc.build(elements)
  
  if __name__ == '__main__':
      testPdf()
  </code></pre>