pythonreports-users Mailing List for PythonReports
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
|
From: Aleksandr S. <al...@go...> - 2017-08-09 06:17:00
|
On 09.08.2017 6:42, Dave Porras wrote: > > I'm trying to use your utility but I'm getting next error: > > C:\Users\dporrasa\Documents\FUSE\Scripts\AutoQualDoc>C:\Python27\python.exe > test_build.py > > Traceback (most recent call last): > File "test_build.py", line 100, in <module> > run() > File "test_build.py", line 80, in run > _printout = _builder.run(sakila.load()[:DATA_LIMIT], > File "C:\Users\dporrasa\Documents\FUSE\Scripts\AutoQualDoc\sakila.py", > line 85, in load > data_file = open(DATA_FILE, "rb") > IOError: [Errno 2] No such file or directory: 'sakila.dat' > > I don't know if there is a file missing in the repo I downloaded or if > that file should be generated for the scripts and it is not being > created. sakila.dat can be downloaded from the project page: https://sourceforge.net/projects/pythonreports/files/Sample%20Data%20file/0.1.0/. This sample data file contains records of the Sakila Sample Database (https://dev.mysql.com/doc/sakila/en/) saved in Python pickle format. Best wishes, alex. |
From: Dave P. <da...@gm...> - 2017-08-09 03:42:57
|
Hi folks, I'm trying to use your utility but I'm getting next error: C:\Users\dporrasa\Documents\FUSE\Scripts\AutoQualDoc>C:\Python27\python.exe test_build.py Traceback (most recent call last): File "test_build.py", line 100, in <module> run() File "test_build.py", line 80, in run _printout = _builder.run(sakila.load()[:DATA_LIMIT], File "C:\Users\dporrasa\Documents\FUSE\Scripts\AutoQualDoc\sakila.py", line 85, in load data_file = open(DATA_FILE, "rb") IOError: [Errno 2] No such file or directory: 'sakila.dat' I don't know if there is a file missing in the repo I downloaded or if that file should be generated for the scripts and it is not being created. Could you please guide me with this? Regards and thanks! -- Ing. Dave Porras Alvarado da...@gm... Cel:(506) 8822 3871 |
From: alexander s. <al...@go...> - 2013-05-30 17:49:33
|
On 30.05.2013 17:21, Werner F. Bruhin wrote: > > I have a report which contains a notes field, when the text is very > large/long it causes a page skip before it starts printing and if it > does not fit to a page then some of the text is truncated. I am sorry, there is no way to split a section. Each report section (title, summary, header, footer, or detail band for one data item) must be completely laid out in one output frame (page or column). Best wishes, alex. |
From: Werner F. B. <wer...@fr...> - 2013-05-30 15:18:50
|
On 30/05/2013 16:21, Werner F. Bruhin wrote: > Hi, > > I have a report which contains a notes field, when the text is very > large/long it causes a page skip before it starts printing and if it > does not fit to a page then some of the text is truncated. > > The notes field is printed via a sub report. > > Any idea what I might be doing wrong that causes this? Forgot to attach the templates, the subreport is defines as being "inline". Werner |
From: Werner F. B. <wer...@fr...> - 2013-05-30 14:19:26
|
Hi, I have a report which contains a notes field, when the text is very large/long it causes a page skip before it starts printing and if it does not fit to a page then some of the text is truncated. The notes field is printed via a sub report. Any idea what I might be doing wrong that causes this? Best regards Werner |
From: Werner F. B. <wer...@fr...> - 2013-04-28 16:27:42
|
Hi, FYI, it looks like ReportLab accepts to this is an issue. https://bitbucket.org/rptlab/reportlab/issue/6/file-name-changed-due-to-utf8str-in Werner On 28/04/2013 17:06, Werner F. Bruhin wrote: > Hi, > > pdfdoc.SaveToFile is using "utf8str" on the file name passed. > > This changes the file name from: > u'C:\\dev\\twcbv4\\data\\generatedReports\\Kellerbuch Liste - > Portr\xe4t.pdf' > > to: > > 'C:\\dev\\twcbv4\\data\\generatedReports\\Kellerbuch Liste - > Portr\xc3\xa4t.pdf' > > Is this for compatibility with older Python versions? > > As on Python 2.7.2 Windows 7 I end up with: > > Kellerbuch Liste - Porträt.pdf > > instead of: > Kellerbuch Liste - Porträt.pdf > > If I just comment the line 234 in pdfdoc "filename = utf8str(filename)" > then all works fine, at least on Py 2.7 Win7 and passing in the unicode > value. > > Do you know why reportlab is changing the file name, shouldn't the > caller be responsible to pass in a valid name. > > I use "get_output_file_name" to get the file name from the user and then > pass this to pdf.write as a unicode value, should/can I do something > different to prevent this change of the file name. > > Werner > > ------------------------------------------------------------------------------ > Try New Relic Now & We'll Send You this Cool Shirt > New Relic is the only SaaS-based application performance monitoring service > that delivers powerful full stack analytics. Optimize and monitor your > browser, app, & servers with just a few lines of code. Try New Relic > and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr > _______________________________________________ > PythonReports-users mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/pythonreports-users > > |
From: Werner F. B. <wer...@fr...> - 2013-04-28 15:04:53
|
Hi, pdfdoc.SaveToFile is using "utf8str" on the file name passed. This changes the file name from: u'C:\\dev\\twcbv4\\data\\generatedReports\\Kellerbuch Liste - Portr\xe4t.pdf' to: 'C:\\dev\\twcbv4\\data\\generatedReports\\Kellerbuch Liste - Portr\xc3\xa4t.pdf' Is this for compatibility with older Python versions? As on Python 2.7.2 Windows 7 I end up with: Kellerbuch Liste - Porträt.pdf instead of: Kellerbuch Liste - Porträt.pdf If I just comment the line 234 in pdfdoc "filename = utf8str(filename)" then all works fine, at least on Py 2.7 Win7 and passing in the unicode value. Do you know why reportlab is changing the file name, shouldn't the caller be responsible to pass in a valid name. I use "get_output_file_name" to get the file name from the user and then pass this to pdf.write as a unicode value, should/can I do something different to prevent this change of the file name. Werner |
From: alexander s. <al...@go...> - 2013-03-24 12:56:28
|
On 21.03.2013 13:18, Werner F. Bruhin wrote: > > The problem was if I defined a top margin on the report then the second > column would align to high (when looking at the generated PDF), so I set > the top margin on the report to zero and set the "top margin" as the > column header hight and now things align correctly. I have fixed it now. Thank you for reporting. > Where would you set the 'eject' to indicate to go to the next label > column? Setting it on the footer seems to work for me, i.e. on my 2 > columns with 6 labels each, it prints the 6 labels in the first column > and then goes to the second column. The logic, in simplified words, is this: - if there is not enough space for next details section, we end current page/column and start a new one. - when we end a page or column, we print respective footer. So, when a footer is built, you already are in the middle of eject sequence. Doing another eject here, if it was processed, would make next column entirely blank. That makes no sense, so the scheme for headers and footers does not include eject elements, and they are ignored as unknown. The eject element is meant to end a column or page prematurely, when there still is enough space for more items. (And sometimes when the builder is not smart enough to figure out requirements for complex templates.) For example, you may want to start each vintage on a new page. If you have no things like that, you do not need to use eject element. > Which is fine with me, also I would prefer that it would do > column 1, row 1, column 2 row 1, column 1 row 2 etc etc That's simple. Make your reporting sequence contain pairs: [(item1, item2), (item3, item4), ...] - and draw a template for two items side by side. Best wishes, alex. |
From: alexander s. <al...@go...> - 2013-03-21 11:02:55
|
On 20.03.2013 15:54, Werner F. Bruhin wrote: >> >> I am trying to do some labels, started with an A5 version which has 2 >> columns. >> >> As you can see from the attached the second column is not correctly >> aligned, i.e. it starts a bit too high. > > It looks like the second column does not shift down by the top margin. > > Hhm, set top margin to zero, activated column header and set the top > margin value for the height of the column header and things are aligned. I am sorry, Werner, I fail to understand what the issue is all about. Do you mean editor interface, or printout building, or what? Best wishes, alex. P.S. By the way, why do you need eject in a footer? I'm not sure it is processed in any way. |
From: Werner F. B. <wer...@fr...> - 2013-03-20 13:52:24
|
On 20/03/2013 11:18, Werner F. Bruhin wrote: > Hi, > > I am trying to do some labels, started with an A5 version which has 2 > columns. > > As you can see from the attached the second column is not correctly > aligned, i.e. it starts a bit too high. It looks like the second column does not shift down by the top margin. Hhm, set top margin to zero, activated column header and set the top margin value for the height of the column header and things are aligned. Werner |
From: Werner F. B. <wer...@fr...> - 2013-03-20 10:17:17
|
Hi, I am trying to do some labels, started with an A5 version which has 2 columns. As you can see from the attached the second column is not correctly aligned, i.e. it starts a bit too high. Werner |
From: alexander s. <al...@go...> - 2013-03-20 10:15:39
|
On 20.03.2013 12:10, Werner F. Bruhin wrote: > > I wanted to start using a standard PDF font, so switched to Times-Roman > but I get this exception with the attached report def. I don't think that is supported. As I see, PythonReports PdfWriter registers TTFont for each facename met in printout. Best wishes, alex. |
From: Werner F. B. <wer...@fr...> - 2013-03-20 10:08:48
|
Hi, I wanted to start using a standard PDF font, so switched to Times-Roman but I get this exception with the attached report def. Can you give me some on hint on what I am doing wrong here. Werner KeyError: 'AAAAAA+CourierNewPSMT' File "c:\dev\twcbv4\twcbsrc\controllers\dreports.py", line 660, 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 391, in doReportWriteAndPreview pdfV.viewer.LoadFile(_filename) File "c:\Python27\Lib\site-packages\wx-2.9.5-msw\wx\lib\pdfviewer\viewer.py", line 196, in LoadFile self.DrawFile(self.frompage, self.topage) File "c:\Python27\Lib\site-packages\wx-2.9.5-msw\wx\lib\pdfviewer\viewer.py", line 473, in DrawFile self.page.extractOperators(), pdf_fonts) File "c:\Python27\Lib\site-packages\wx-2.9.5-msw\wx\lib\pdfviewer\viewer.py", line 565, in ProcessOperators drawlist.extend(self.DrawTextString(operand[0])) File "c:\Python27\Lib\site-packages\wx-2.9.5-msw\wx\lib\pdfviewer\viewer.py", line 630, in DrawTextString dlist.append(self.DrawTextItem(item, f)) File "c:\Python27\Lib\site-packages\wx-2.9.5-msw\wx\lib\pdfviewer\viewer.py", line 642, in DrawTextItem width = stringWidth(textitem, g.font, g.fontSize) File "c:\Python27\Lib\site-packages\reportlab-2.6-py2.7-win32.egg\reportlab\pdfbase\pdfmetrics.py", line 723, in stringWidth return getFont(fontName).stringWidth(text, fontSize, encoding=encoding) File "c:\Python27\Lib\site-packages\reportlab-2.6-py2.7-win32.egg\reportlab\pdfbase\pdfmetrics.py", line 689, in getFont return findFontAndRegister(fontName) File "c:\Python27\Lib\site-packages\reportlab-2.6-py2.7-win32.egg\reportlab\pdfbase\pdfmetrics.py", line 671, in findFontAndRegister face = getTypeFace(fontName) File "c:\Python27\Lib\site-packages\reportlab-2.6-py2.7-win32.egg\reportlab\pdfbase\pdfmetrics.py", line 630, in getTypeFace return _typefaces[faceName] |
From: Werner F. B. <wer...@fr...> - 2013-03-20 08:24:23
|
Hi Alex, Just an FYI. There was an issue with images not showing, which was fixed by David Hughes over the weekend - see attached. I use it from within my 'report manager' to allow to write a pdf and immediately preview it. from wx.lib.pdfviewer import pdfViewer, pdfButtonPanel class PDFViewer(sc.SizedFrame): def __init__(self, parent, **kwds): super(PDFViewer, self).__init__(parent, **kwds) contPane = self.GetContentsPane() self.buttonpanel = pdfButtonPanel(contPane, wx.NewId(), wx.DefaultPosition, wx.DefaultSize, 0) self.buttonpanel.SetSizerProps(expand=True) self.viewer = pdfViewer(contPane, wx.NewId(), wx.DefaultPosition, wx.DefaultSize, wx.HSCROLL|wx.VSCROLL|wx.SUNKEN_BORDER) self.viewer.SetSizerProps(expand=True, proportion=1) # introduce buttonpanel and viewer to each other self.buttonpanel.viewer = self.viewer self.viewer.buttonpanel = self.buttonpanel And then to use it I pass the file which was previously created by pdf.write: pdfV = PDFViewer(self.view) pdfV.viewer.LoadFile(_filename) pdfV.Show() Werner |
From: Werner F. B. <wer...@fr...> - 2013-03-20 08:02:31
|
Hi Alex, Thanks for fixing this. Werner |
From: Werner F. B. <wer...@fr...> - 2013-03-20 07:49:52
|
Hi, Attached a patch which will persist the layout of the different property dialogs. This patch is depended on the WIT and persist patch some time ago for the designer. It is also depended on a patch I submitted for wx.lib.agw.persist (RestoreAll). Werner |
From: Werner F. B. <wer...@fr...> - 2013-03-19 16:28:59
|
Hi, Attached is a patch which keeps track of data changed and if data is saved lets you ouf of the designer without the warning dialog. What do you think? Initial tests of this works for me, but need to test it some more to be sure that all changes will get caught and set flag that data needs to be saved. Werner |
From: alexander s. <al...@go...> - 2013-03-19 13:11:47
|
Werner F. Bruhin wrote, at 19.03.2013 12:46: > > In some of my reports have something like this: > > Some nice wine name > its vintage etc etc > Some longish notes field for this wine, but this notes field is > optional. - THIS.vintage.notes SQLAlchemy column > > The notes field should only be there if there is text, in other words if > there is no text there should be no space between this wine and the next > one. > > In ReportManager which I use up to now I could have multiple detail > sections/element and define to "shrink" the section which has no data. "float" attribute for box element is meant to reposition fields when things above in the same section grow or shrink. Best wishes, alex. |
From: Werner F. B. <wer...@fr...> - 2013-03-19 12:30:28
|
Hi, I find the property dialog often too small to see things nicely. Attached a small patch to allow to resize it. Werner |
From: Werner F. B. <wer...@fr...> - 2013-03-19 12:26:14
|
Hi, Got it, just needed to change the "when" attribute for the sub report. Werner |
From: Werner F. B. <wer...@fr...> - 2013-03-19 10:45:09
|
Hi, In some of my reports have something like this: Some nice wine name its vintage etc etc Some longish notes field for this wine, but this notes field is optional. - THIS.vintage.notes SQLAlchemy column The notes field should only be there if there is text, in other words if there is no text there should be no space between this wine and the next one. In ReportManager which I use up to now I could have multiple detail sections/element and define to "shrink" the section which has no data. I had a go at using sub-report for this, but I still end up with a blank line if there are no notes. The sub-report is this: <report> <font name="body" size="8" typeface="Arial" /> <import alias="rc" path="twcbsrc.reports.repconstants" /> <import alias="ru" path="twcbsrc.reports.rutils" /> <import alias="gi" path="twcbsrc.reports.rutils.getRelInfo" /> <layout bottommargin="0" leftmargin="0" pagesize="A4" rightmargin="0" topmargin="0"> <style bgcolor="#FFFFFF" color="#000000" font="body" /> <detail> <box height="12" /> <field expr="THIS.notes" stretch="true"> <box height="0" width="445" x="20" /> </field> </detail> </layout> </report> Any other trick one can use? Werner |
From: Werner F. B. <wer...@fr...> - 2013-03-19 10:04:36
|
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 |
From: alexander s. <al...@go...> - 2013-03-18 14:14:28
|
Werner F. Bruhin wrote, at 18.03.2013 15:41: > > I noticed that in datatypes.py A6 is defined as: > > "A6": (Dimension("105mm"), Dimension("297mm")), > > should be: > > "A6": (Dimension("105mm"), Dimension("148mm")), > > http://www.papersizes.org/a-paper-sizes.htm Of course. Thank you. Best wishes, alex. |
From: Werner F. B. <wer...@fr...> - 2013-03-18 13:39:22
|
Hi Alex, I noticed that in datatypes.py A6 is defined as: "A6": (Dimension("105mm"), Dimension("297mm")), should be: "A6": (Dimension("105mm"), Dimension("148mm")), http://www.papersizes.org/a-paper-sizes.htm After that change I just need to select an appropriate paper size in Acrobat Reader (AR). Pity that this can't be set somehow from within PythonReport. I tried it with a hack by defaulting pagesize in pdf.py to A6 but no success. It seems that AR is picking up the default paper size from the printer instead of getting it from the document and maybe complain if that is not supported by the printer - is that your experience too. Werner |
From: Werner F. B. <wer...@fr...> - 2013-03-15 16:01:28
|
Hi Alex, On 14/03/2013 19:22, alexander smishlajev wrote: > Werner F. Bruhin wrote, at 14.03.2013 18:47: >> I am still fighting with my card 10 x 15 cm or in inches it is 4 x 6. >> >> It is all layed out correctly now but I can do whatever I want it will >> not print on my cards correctly on a Canon printer. >> >> At this point I am quit sure it has to do with the paper size over >> ridding the custom size. In other words PythonReports passes the page >> size to the pdf writer stuff and the size (width/height) on the report >> level definition are ignored. > http://pythonreports.sourceforge.net/prt.shtml#layout > > width and height attributes are ignored if pagesize is specified. Please find attached a patch to allow not to specify a paper size in the editor. Werner |