Unless you've skipped some of your code, your data
dictionary only gets created if the condition in this line is matched:
if int(el.attrib['left']) < 11: data = { 'Report Name': el.text }
All of your other lines where you set values in data
depend on it already existing, so you'll get the NameError
if this first condition isn't matched.
The quick fix would be to always create an empty data dictionary, e.g.
for page in pages[0:1]:
for el in page:
data = {}
if el.tag =="text":
etc.