pythonreports-users Mailing List for PythonReports (Page 6)
Brought to you by:
a1s
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(78) |
2013 |
Jan
(15) |
Feb
(12) |
Mar
(25) |
Apr
(2) |
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Werner F. B. <wer...@fr...> - 2012-12-05 14:59:33
|
Hi Alex, To fix the following assertion error with 2.9.4 I changed around line 494 in editor.elements.design.py to this: #TODO: Apply font from active style _font = wx.Font(DEFAULT_FONT_SIZE * self.app.zoom_get(), wx.FONTFAMILY_DEFAULT, wx.NORMAL, wx.NORMAL) dc.SetFont(_font) I.e. change wx.NORMAL for the family parameter to wx.FONTFAMILY_DEFAULT. Just installed Bazaar (as HG doesn't have a plugin for it), but can't see in there how to generate a patch or similar - any hint for future would be welcome. Werner wx._core.PyAssertionError: C++ assertion "ff_family != (0<<4)" failed at ..\..\src\msw\font.cpp(651) in wxNativeFontInfo::SetFamily(): unknown wxFontFamily File "c:\dev\twcbv4\twcbsrc\reports\testPyRep.py", line 71, in <module> ptedit() File "C:\dev\pythonreports\trunk\PythonReports\editor\editor.py", line 11, in main _app.MainLoop() File "c:\Python27\Lib\site-packages\wx-2.9.4-msw\wx\_core.py", line 8660, in MainLoop wx.PyApp.MainLoop(self) File "c:\Python27\Lib\site-packages\wx-2.9.4-msw\wx\_core.py", line 7952, in MainLoop return _core_.PyApp_MainLoop(*args, **kwargs) File "c:\Python27\Lib\site-packages\wx-2.9.4-msw\wx\lib\ogl\_canvas.py", line 76, in OnPaint self.GetDiagram().Redraw(dc) File "c:\Python27\Lib\site-packages\wx-2.9.4-msw\wx\lib\ogl\_diagram.py", line 41, in Redraw object.Draw(dc) File "c:\Python27\Lib\site-packages\wx-2.9.4-msw\wx\lib\ogl\_basic.py", line 1154, in Draw self.GetEventHandler().OnDraw(dc) File "c:\Python27\Lib\site-packages\wx-2.9.4-msw\wx\lib\ogl\_basic.py", line 88, in OnDraw self._previousHandler.OnDraw(dc) File "C:\dev\pythonreports\trunk\PythonReports\editor\elements\design.py", line 496, in OnDraw wx.NORMAL, wx.NORMAL, wx.NORMAL) File "c:\Python27\Lib\site-packages\wx-2.9.4-msw\wx\_gdi.py", line 2253, in __init__ _gdi_.Font_swiginit(self,_gdi_.new_Font(*args, **kwargs)) |
From: alexander s. <al...@go...> - 2012-12-05 12:00:03
|
On 05.12.2012 12:22, Werner F. Bruhin wrote: > > Following are things I notice > > - "Code completion" on the "expr" field to help not making stupid typos, > e.g. I need the field "drinkinfo.name" for one field > - if above is to much work/problem maybe use a different shell - e.g. > PyCrust 0.9.8 - The Flakiest Python Shell which is part of the wx > distribution, so one would get code completion on the following. > > - show the template file name in the title bar > - or maybe show the template file name in a tab and allow working on > multiple template files - I know I am pushing it:-) > - a way to run/preview the report from within the designer > - Persist the layout of the editor window(s) - so on next startup one > does have to e.g. enlarge the properties section (wx.lib.agw.persist > might be useful for this) > - Have a Save-as and a Save option, the later should not always ask for > the template name > - Tooltips for the properties, in a way that it does not disturb using > the properties editor (maybe a wx.lib.supertooltip over the layout when > working in the property editor) I welcome patches implementing whatever feature you find useful. Even if your patch does not find it's way to the mainline sources, ir really helps to have a starting point to design a new feature. I doubt I'd like to have PyCrust instead of plain shell, though. I think the PyCrust notebook would eat up quite a bit of the screen space, and we don't have too much of that. There is report preview feature in the Tk-based template editor. > Using the sakila template to get a better idea what needs to go where. Please be aware that the sample data file contains a lot of records. In order to play with template, it is better to use a smaller set. For example, >>> from sakila import load >>> data = load()[:200] > Do I need to do an install/setup of PythonReport if I like to use rev > 225? Or can I just do a checkout? For a playground, you could just add the checkout directory to the PYTHONPATH environment variable. For production use, you'd better execute python setup.py bdist_wininst, and then run the installer to add the package to your system. (I assume you are on Windows because there are Windows paths in your tracebacks.) Best wishes, alex. |
From: Werner F. B. <wer...@fr...> - 2012-12-05 10:20:54
|
Hi Alex, I am using it with wxPython 2.8, at least for the next few days to get more familiar with it. Following are things I notice - "Code completion" on the "expr" field to help not making stupid typos, e.g. I need the field "drinkinfo.name" for one field - if above is to much work/problem maybe use a different shell - e.g. PyCrust 0.9.8 - The Flakiest Python Shell which is part of the wx distribution, so one would get code completion on the following. >>> data [Cellarbook(storagelocation=None), Cellarbook(storagelocation=None), Cellarbook(storagelocation=None), Cellarbook(storagelocation=None), Cellarbook(storagelocation=None), Cellarbook(storagelocation=None), Cellarbook(storagelocation=None), Cellarbook(storagelocation=None), Cellarbook(storagelocation=None)] >>> data[0].drinkinfo.name u'Goldwater Esslin' - show the template file name in the title bar - or maybe show the template file name in a tab and allow working on multiple template files - I know I am pushing it:-) - a way to run/preview the report from within the designer - Persist the layout of the editor window(s) - so on next startup one does have to e.g. enlarge the properties section (wx.lib.agw.persist might be useful for this) - Have a Save-as and a Save option, the later should not always ask for the template name - Tooltips for the properties, in a way that it does not disturb using the properties editor (maybe a wx.lib.supertooltip over the layout when working in the property editor) Using the sakila template to get a better idea what needs to go where. Do I need to do an install/setup of PythonReport if I like to use rev 225? Or can I just do a checkout? Best regards Werner |
From: Werner F. B. <wer...@fr...> - 2012-12-05 09:57:03
|
Hi Alex, On 05/12/2012 10:39, alexander smishlajev wrote: ... > I believe this is fixed with > http://pythonreports.bzr.sourceforge.net/bzr/pythonreports/revision/225 That was fast! Werner |
From: alexander s. <al...@go...> - 2012-12-05 09:40:50
|
On 04.12.2012 22:22, Werner F. Bruhin wrote: > > 1. Click on "New Template" > 2. create "data" > 3. Click on "New Field" > 4. Click within "Detail" band I get this exception: > > wx._core.PyAssertionError: C++ assertion "Assert failure" failed at > ..\..\src\propgrid\propgridpagestate.cpp(1673) in > wxPropertyGridPageState::PrepareToAddItem(): wxPropertyGrid item with > name "data" ... (truncated) > "c:\Python27\Lib\site-packages\PythonReports\editor\propertiesgrid.py", > line 261, in setup_by_element > self.append_atributes(_tag, _body) > File > "c:\Python27\Lib\site-packages\PythonReports\editor\propertiesgrid.py", > line 308, in append_atributes > self.Append(wxpg.PropertyCategory(tag)) > File "c:\Python27\Lib\site-packages\wx-2.9.4-msw\wx\propgrid.py", line > 1096, in Append > return _propgrid.PropertyGridInterface_Append(*args, **kwargs) I believe this is fixed with http://pythonreports.bzr.sourceforge.net/bzr/pythonreports/revision/225 Best wishes, alex. |
From: Werner <wer...@sf...> - 2012-12-05 08:55:46
|
Robin and Alex, I had a reply from both of you, I'll copy both lists on this. On 05/12/2012 09:17, Robin Dunn wrote: > On 12/5/12 12:05 AM, Werner wrote: >> Hi, >> >> Still testing PythonReports, I would like to use it with 2.9.4, but run >> into the following problem. >> >> I just tested if I run it with 2.8 and install the wxpropgrid from >> https://sourceforge.net/projects/wxpropgrid/ I don't see this. >> >> What is the assert checking in the C++ code? Maybe that gives me a hint >> on what needs to be done differently in 2.9.4. >> > > if ( BaseGetPropertyByName(property->GetName()) && > (!scheduledParent || scheduledParent->IsCategory()) ) > { > wxFAIL_MSG(wxString::Format( > "wxPropertyGrid item with name \"%s\" already exists", > property->GetName())); > > wxPGGlobalVars->m_warnings++; > } > Quote of Alex's reply: I have wxPropertyGrid installed as separate module: http://wxpropgrid.sourceforge.net/ I will give this a try and see, I assume you use version 1.4? Yes, 1.4.15. I have just got mail from author of the editor. He did not reproduce the exception (neither did me), but he thinks he nailed the problem down. The exception is about duplicate name, and the assertion fails when we add a category named "data" when there already is a field named "data" in category "field". It looks like a bug in wxPropertyGrid: logically, field names and category names would go to different name spaces. And you get the exception because you use development version of wxPython which has assertions enabled. End Quote This is what I get when I run it with 1.4.15 installed into wxPython 2.8.12 in the prop grid, so it confirms that there is problem with duplicate name, hopefully fix will make it into 2.9.5:-) . Werner |
From: Werner F. B. <wer...@fr...> - 2012-12-05 07:36:34
|
Hi Alex, I am quoting here the response from Cody: On 05/12/2012 04:27, Cody wrote: > Hi, > > On Tue, Dec 4, 2012 at 6:41 PM, Robin Dunn <ro...@al... > <mailto:ro...@al...>> wrote: > > ... > > 2. It is also using platebtn.SetState which does not exist > either, there > is only the _SetState. Haven't quit figured out why they are > setting > the state manually. > > > Cody will need to answer this one, but it looks like the version > in the 2.9 source tree is much newer than the one in the 2.8 tree > if that gives you any hints. > > > The SetState method should not have been exposed to begin with. Used > 2.9 as a point to hide it. So its gone and not likely to come back. > When was this called in the first place, when I just commented them yesterday I didn't really see another behaviour - but I might have missed it. Will have another look at it today. Werner |
From: alexander s. <al...@go...> - 2012-12-04 20:38:24
|
On 04.12.2012 22:11, Werner F. Bruhin wrote: > > I'll like to give the designer a go for a bit. So, tried first to use > it with wxPython 2.8x but it uses wx.propgrid which is only available as > of 2.9.0.1. I have wxPropertyGrid installed as separate module: http://wxpropgrid.sourceforge.net/ > And the following is one of the 1%, I'll report/ask about it on the > wxPython list, i.e. the recommended spelling was I believe always "Colour". That's right. I have checked in the spelling fix. Thank you for reporting it. Best wishes, alex. |
From: Werner F. B. <wer...@fr...> - 2012-12-04 20:21:31
|
When I do: 1. Click on "New Template" 2. create "data" >>> data = ds.query(db.Cellarbook).all() >>> data [Cellarbook(storagelocation=None), Cellarbook(storagelocation=None), Cellarbook(storagelocation=None), Cellarbook(storagelocation=None), Cellarbook(storagelocation=None), Cellarbook(storagelocation=None), Cellarbook(storagelocation=None), Cellarbook(storagelocation=None), Cellarbook(storagelocation=None)] 3. Click on "New Field" 4. Click within "Detail" band I get this exception: wx._core.PyAssertionError: C++ assertion "Assert failure" failed at ..\..\src\propgrid\propgridpagestate.cpp(1673) in wxPropertyGridPageState::PrepareToAddItem(): wxPropertyGrid item with name "data" ... (truncated) File "c:\dev\twcbv4\twcbsrc\reports\dbtest.py", line 66, in <module> ptedit() File "c:\Python27\Lib\site-packages\PythonReports\editor\editor.py", line 11, in main _app.MainLoop() File "c:\Python27\Lib\site-packages\wx-2.9.4-msw\wx\_core.py", line 8660, in MainLoop wx.PyApp.MainLoop(self) File "c:\Python27\Lib\site-packages\wx-2.9.4-msw\wx\_core.py", line 7952, in MainLoop return _core_.PyApp_MainLoop(*args, **kwargs) File "c:\Python27\Lib\site-packages\wx-2.9.4-msw\wx\lib\ogl\_canvas.py", line 249, in OnMouseEvent self.OnLeftClick(x, y, keys) File "c:\Python27\Lib\site-packages\PythonReports\editor\elements\design.py", line 94, in OnLeftClick self.add_element(_class_to_create(self, x, y)) File "c:\Python27\Lib\site-packages\PythonReports\editor\elements\design.py", line 482, in __init__ self.init_shape(parent_canvas, x, y, sync_box) File "c:\Python27\Lib\site-packages\PythonReports\editor\elements\design.py", line 310, in init_shape self.synchronize_box() File "c:\Python27\Lib\site-packages\PythonReports\editor\elements\design.py", line 458, in synchronize_box self.app.focus_set(self) File "c:\Python27\Lib\site-packages\PythonReports\editor\application.py", line 46, in focus_set self.frame.property_grid.setup_by_element(listener) File "c:\Python27\Lib\site-packages\PythonReports\editor\propertiesgrid.py", line 261, in setup_by_element self.append_atributes(_tag, _body) File "c:\Python27\Lib\site-packages\PythonReports\editor\propertiesgrid.py", line 308, in append_atributes self.Append(wxpg.PropertyCategory(tag)) File "c:\Python27\Lib\site-packages\wx-2.9.4-msw\wx\propgrid.py", line 1096, in Append return _propgrid.PropertyGridInterface_Append(*args, **kwargs) Any hints on what I am doing wrong? Werner |
From: Werner F. B. <wer...@fr...> - 2012-12-04 20:10:19
|
Hi Alex, I'll start again, sorry didn't pay attention that the copy/past only gave part of the call stack. I'll do one per item, so it is easier to follow. I'll like to give the designer a go for a bit. So, tried first to use it with wxPython 2.8x but it uses wx.propgrid which is only available as of 2.9.0.1. Re "stable" and "unstable", I assume you are aware that this is only in relation to the API being not stable and in 99% only for the new stuff added. And the following is one of the 1%, I'll report/ask about it on the wxPython list, i.e. the recommended spelling was I believe always "Colour". AttributeError: 'module' object has no attribute 'Color' File "c:\dev\twcbv4\twcbsrc\reports\dbtest.py", line 56, in <module> from PythonReports.editor.editor import main as ptedit File "c:\Python27\Lib\site-packages\PythonReports\editor\editor.py", line 7, in <module> from PythonReports.editor.application import EditorApplication File "c:\Python27\Lib\site-packages\PythonReports\editor\application.py", line 8, in <module> from mainform import EditorForm File "c:\Python27\Lib\site-packages\PythonReports\editor\mainform.py", line 15, in <module> from elementstree import ElementsTree File "c:\Python27\Lib\site-packages\PythonReports\editor\elementstree.py", line 9, in <module> from elements.section import Section File "c:\Python27\Lib\site-packages\PythonReports\editor\elements\section.py", line 14, in <module> from design import DesignPlace File "c:\Python27\Lib\site-packages\PythonReports\editor\elements\design.py", line 19, in <module> from element import Element File "c:\Python27\Lib\site-packages\PythonReports\editor\elements\element.py", line 8, in <module> from ..propertiesgrid import PropertiesListener File "c:\Python27\Lib\site-packages\PythonReports\editor\propertiesgrid.py", line 208, in <module> class PropertiesGrid(wxpg.PropertyGrid): File "c:\Python27\Lib\site-packages\PythonReports\editor\propertiesgrid.py", line 270, in PropertiesGrid NONE_COLOR = wx.Color(160, 255, 160) Werner |
From: alexander s. <al...@go...> - 2012-12-04 19:20:40
|
On 04.12.2012 18:15, Werner F. Bruhin wrote: > > When I try to run the above I get some exceptions. What's "the above" and which exception do you get? I see some portion of traceback, but no exception. I see no error in propertiesgrid.py around line 270, either. > container.py, line 81, in highlight > self.SetState(wxpltbns.PLATE_PRESSED) > > I stop at this point as I might be on a wx version you don't yet support. > > I am on Python 2.7.2 on Windows 7 and run wxPython 2.9.4 in that version > platebtn does not have a method called SetState, it only has GetState as > far as I can see. Looks like it was lost in upstream merge: http://svn.wxwidgets.org/viewvc/wx/wxPython/tags/wxPy-2.9.4.0/wxPython/wx/lib/platebtn.py?r1=67853&r2=69231 Perhaps you should make it known to wxPython team. > Is 2.9.4 supposed to be supported? I doubt so. The time I am able to spend on PythonReports is too scanty to fiddle with non-stable versions of used libraries. > You don't want to move the support list to e.g. Google Groups as > sourceforge is really slow:-( Well, as long as support is limited to me alone, slow mail barely is a shortcoming because I'm quite slow myself. I have never used Google Groups, and I am not motivated enough to start learning them. On 04.12.2012 18:42, Werner F. Bruhin wrote: > > I will use the project to report from a Firebird SQL database, > preferably via SQLAlchemy. Please feel free to do so. PythonReports are intentionaly unaware of data sources; I am sure that data extraction and output formatting are very different tasks, and must be separated for modularity. Instead, PythonReports accept both objects (probably composed by an ORM layer) and Python dictionaries as data items. That should ease composition of input data from any source. > So, what is the best way to provide the "data" to the editor.py when I > like to create a template? I make a module with a function returning data, and then in report designer shell I paste two lines: >>> from mymodule import myfunction >>> data = myfunction() Please be aware that although report builder and pdf output have been in production use for half a decade now, the template designers - both Tk-based and wx-based - barely got any real use. Cheers, alex. |
From: Werner F. B. <wer...@fr...> - 2012-12-04 16:41:47
|
Hi, Doing a bit more research I see that currently platebtn._SetState exists, so I changed it here. I will use the project to report from a Firebird SQL database, preferably via SQLAlchemy. So, what is the best way to provide the "data" to the editor.py when I like to create a template? Werner |
From: Werner F. B. <wer...@fr...> - 2012-12-04 16:14:06
|
Hi, I just discovered your project and started to evaluate it if it fits my needs. When I try to run the above I get some exceptions. editor.py, line 7, in <module> from PythonReports.editor.application import EditorApplication application.py, line 8, in <module> from mainform import EditorForm mainform.py, line 15, in <module> from elementstree import ElementsTree elementstree.py, line 9, in <module> from elements.section import Section section.py, line 14, in <module> from design import DesignPlace design.py, line 19, in <module> from element import Element element.py, line 8, in <module> from propertiesgrid import PropertiesListener propertiesgrid.py, line 208, in <module> class PropertiesGrid(wxpg.PropertyGrid): propertiesgrid.py, line 270, in PropertiesGrid NONE_COLOR = wx.Color(160, 255, 160) Commenting lines 270 and 271 in PropertiesGrid and changing lines 278 to this: if prop_type is None: #_cell.SetBgCol(self.NONE_COLOR) _cell.SetBgCol(wx.Color(160, 255, 160)) elif prop_type is datatypes.REQUIRED: #_cell.SetBgCol(self.REQUIRED_COLOR) _cell.SetBgCol(wx.Color(255, 192, 208)) At this point the TemplateEditor starts. Clicking on new Template I get this exception: editor.py, line 15, in <module> main() editor.py, line 11, in main _app.MainLoop() _core.py, line 8660, in MainLoop wx.PyApp.MainLoop(self) _core.py, line 7952, in MainLoop return _core_.PyApp_MainLoop(*args, **kwargs) auibar.py, line 3704, in OnLeftUp self.ProcessEvent(e) _core.py, line 4154, in ProcessEvent return _core_.EvtHandler_ProcessEvent(*args, **kwargs) toolbar.py, line 39, in OnNew self.app.report_new() application.py, line 113, in report_new self.focus_set(self.frame.workspace.get_report()) application.py, line 45, in focus_set listener.highlight(True) container.py, line 130, in highlight self.GetButton().highlight(need_hl) container.py, line 81, in highlight self.SetState(wxpltbns.PLATE_PRESSED) I stop at this point as I might be on a wx version you don't yet support. I am on Python 2.7.2 on Windows 7 and run wxPython 2.9.4 in that version platebtn does not have a method called SetState, it only has GetState as far as I can see. Is 2.9.4 supposed to be supported? Werner P.S. You don't want to move the support list to e.g. Google Groups as sourceforge is really slow:-( |
From: alexander s. <al...@ty...> - 2007-11-15 10:19:06
|
Виктор wrote, at 15.11.2007 8:23: > > Пытаюсь использовать PythonReports. Прошу помощь. > Как задавать переменную data в дизайнере (на примере sakila.dat)? в шелле набираешь: Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32 Set "data" variable to report data sequence for preview. >>> from sakila import load >>> data = load()[:10] >>> естественно, можно взять и более длинный набор данных. всего load() возвращает 16044 объекта (все, что было в примере MySQL). такую длинную последовательность можно использовать для оценки производительности, но работать с ней в дизайнере неудобно. > Где есть информация об использовании PythonReports? есть только то, что на сайте. желаю здравствовать, alex. |
From: alexander s. <al...@ty...> - 2006-12-23 08:20:24
|
Alagu Madhu wrote, at 23.12.2006 9:36: > > I would to use pythonreports with wxpython. it is not recommended to use wxPython renderer - there are major problems that do not seem to be easily fixable. (although it might work unless you need to print bar codes.) much better results may be achieved by rendering to pdf and then running acrobat reader via wx.lib.pdfwin.PDFWindow. > But I not get any document or example > to start my project.Please,can you send me > some example with screen and print option ? pythonreports documentation (as much as there is - input and output file specifications, release history and small readme) is included with both source and binary distributions. the specs are also viewable at http://pythonreports.sourceforge.net/ example report templates and build scripts are in the test directory of the source distribution, also accessible through cvs browser at http://pythonreports.cvs.sourceforge.net/pythonreports/PythonReports/test/. one of the report examples uses data from Sakila sample database published by MySQL AB (see http://dev.mysql.com/doc/sakila/en/sakila.html). if you do not have MySQL installed, you may fetch preloaded report data file from the project downloads, distributed in a separate package. all printout rendering modules have command line interface. best wishes, alex. |