Hi,
If I uncheck a "summary" in a group headers property then save and
reload the report definition I get this exception:
AttributeError: 'NoneType' object has no attribute 'tag'
File "c:\dev\twcbv4\twcbsrc\controllers\dreports.py", line 662, in <module>
dlg.ShowModal()
File "c:\Python27\Lib\site-packages\wx-2.9.5-msw\wx\_windows.py", line
805, in ShowModal
return _windows_.Dialog_ShowModal(*args, **kwargs)
File
"c:\Python27\Lib\site-packages\wx-2.9.5-msw\wx\lib\agw\aquabutton.py",
line 434, in OnLeftUp
self.Notify()
File
"c:\Python27\Lib\site-packages\wx-2.9.5-msw\wx\lib\agw\aquabutton.py",
line 864, in Notify
self.GetEventHandler().ProcessEvent(evt)
File "c:\Python27\Lib\site-packages\wx-2.9.5-msw\wx\_core.py", line
4154, in ProcessEvent
return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
File "c:\dev\twcbv4\twcbsrc\controllers\dreports.py", line 438, in
doReportDesign
env.report_open(self.getReportFile())
File
"c:\Python27\Lib\site-packages\PythonReports\editor\environment.py",
line 202, in report_open
templateloader.load_template(_template, _report)
File
"c:\Python27\Lib\site-packages\PythonReports\editor\templateloader.py",
line 20, in load_template
load_report(template.getroot(), report)
File
"c:\Python27\Lib\site-packages\PythonReports\editor\templateloader.py",
line 39, in load_report
load_groups(_xml_layout, report)
File
"c:\Python27\Lib\site-packages\PythonReports\editor\templateloader.py",
line 89, in load_groups
load_group(_xml_group, report)
File
"c:\Python27\Lib\site-packages\PythonReports\editor\templateloader.py",
line 104, in load_group
load_section_pair(xml_group, _report_group, (te.Title.tag,
te.Summary.tag))
File
"c:\Python27\Lib\site-packages\PythonReports\editor\templateloader.py",
line 112, in load_section_pair
section_pair.get_second())
File
"c:\Python27\Lib\site-packages\PythonReports\editor\templateloader.py",
line 119, in load_one_of_pair
section_pair.set_value("headers", xml_section.tag,
Looking at the code I changed this:
def load_one_of_pair(xml_section, section_pair, report_section):
"""Load one of section pair sections"""
_has_section = xml_section is not None
section_pair.set_value("headers", xml_section.tag,
datatypes.Boolean(_has_section))
if _has_section:
load_section(xml_section, report_section)
to:
def load_one_of_pair(xml_section, section_pair, report_section):
"""Load one of section pair sections"""
_has_section = xml_section is not None
if _has_section:
section_pair.set_value("headers", xml_section.tag,
datatypes.Boolean(_has_section))
load_section(xml_section, report_section)
The file loads without error but the "summary" check box is checked
again and there is a summary "element".
As a work around I just set the height of the summary element to zero.
Werner
|